From patchwork Mon Aug 17 15:14:08 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: 266432 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, USER_AGENT_GIT autolearn=ham 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 85F33C433E1 for ; Mon, 17 Aug 2020 15:50:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B59B20674 for ; Mon, 17 Aug 2020 15:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679439; bh=EGmXluOUHO25U06vCs4b8FJqku0OIik3wXzBz25SqUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mGIK1ZwMv+wzsyEf3HH6L2Fcj2FV9/JpTepH/8uDnsbR9qEOaIXRX6I4p2ZK8DoO1 nvFHbjJhHRjXaJNATkDV6Z+VORJW5xPqsu9MTAdH+DWb9GwVm5JaT/iPFc1ZuwjnkZ +iPWt0u3yV1rXqmuSGhdyDdxZhHeCSUuoyNYi6mk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730878AbgHQPua (ORCPT ); Mon, 17 Aug 2020 11:50:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:34422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730773AbgHQPuG (ORCPT ); Mon, 17 Aug 2020 11:50:06 -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 C75112245C; Mon, 17 Aug 2020 15:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679398; bh=EGmXluOUHO25U06vCs4b8FJqku0OIik3wXzBz25SqUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jMnGfXpOOgOpGwU40FzmhZR34XKatGyPj0hwZnYFX9YQzdqZea44PIcdJCQNpbCX1 xcFWce0NFocW3pK+1jVfPTDQB/8y+hL76Zv5aTIDV7ujdqHKwMu55u54lj9R7fuZkQ loUMfma34vx2qGJ57Y1u4HPw8xoDeIu/3gbha9jI= 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.7 198/393] drm/bridge: sil_sii8620: initialize return of sii8620_readb Date: Mon, 17 Aug 2020 17:14:08 +0200 Message-Id: <20200817143829.227122165@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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;