From patchwork Mon Aug 17 15:12:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 265974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50BD9C433E1 for ; Mon, 17 Aug 2020 19:34:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3305520674 for ; Mon, 17 Aug 2020 19:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597692874; bh=EGmXluOUHO25U06vCs4b8FJqku0OIik3wXzBz25SqUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OX6ddqHNk2BqsFpuXSYDrfX2Eblz35rlaPSdwaDphC8+giISA39bNpx2KlNa63D8v U9ig7Xex+q8Zue6C6uuoCUDGPb0j1RHoDyYJROOyQti94QIoqfcbNgkDygh6LNuYbH JQ7LnYpHoT9MNGPl1ks4PeNWpHQl8A8TCz+9Yd20= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730169AbgHQTeV (ORCPT ); Mon, 17 Aug 2020 15:34:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:50948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729720AbgHQPaN (ORCPT ); Mon, 17 Aug 2020 11:30:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 797AF2395B; Mon, 17 Aug 2020 15:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678213; bh=EGmXluOUHO25U06vCs4b8FJqku0OIik3wXzBz25SqUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YJWgiKmsfi7hWNdFoYAg1WIAgYC4Mpe+hi9FDYnAEVbaOJ0WNKx3lTz7dugDAuhQT +oNtnM0MpXWPL6QesMYXjMrmzK/OnjOC2nw4SsImD6XTAZU8PPfqocfqVN3666JPvJ ibGfFAG537QH6lQVpPJ3jK2t8hlmP5g+LHrUBbdI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Laurent Pinchart , Andrzej Hajda , Sam Ravnborg , Sasha Levin Subject: [PATCH 5.8 226/464] drm/bridge: sil_sii8620: initialize return of sii8620_readb Date: Mon, 17 Aug 2020 17:12:59 +0200 Message-Id: <20200817143844.622127881@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tom Rix [ Upstream commit 02cd2d3144653e6e2a0c7ccaa73311e48e2dc686 ] clang static analysis flags this error sil-sii8620.c:184:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn] return ret; ^~~~~~~~~~ sii8620_readb calls sii8620_read_buf. sii8620_read_buf can return without setting its output pararmeter 'ret'. So initialize ret. Fixes: ce6e153f414a ("drm/bridge: add Silicon Image SiI8620 driver") Signed-off-by: Tom Rix Reviewed-by: Laurent Pinchart Reviewed-by: Andrzej Hajda Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200712152453.27510-1-trix@redhat.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/sil-sii8620.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 92acd336aa894..ca98133411aab 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -178,7 +178,7 @@ static void sii8620_read_buf(struct sii8620 *ctx, u16 addr, u8 *buf, int len) static u8 sii8620_readb(struct sii8620 *ctx, u16 addr) { - u8 ret; + u8 ret = 0; sii8620_read_buf(ctx, addr, &ret, 1); return ret;