From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: trix@redhat.com
Cc: jernej.skrabec@siol.net, jonas@kwiboo.se, airlied@linux.ie,
narmstrong@baylibre.com, architt@codeaurora.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
a.hajda@samsung.com, stable@vger.kernel.org
Subject: Re: [PATCH] drm/bridge: sil_sii8620: initialize return of sii8620_readb
Date: Sun, 12 Jul 2020 18:34:49 +0300 [thread overview]
Message-ID: <20200712153449.GA6642@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200712152453.27510-1-trix@redhat.com>
Hi Tom,
Thank you for the patch.
On Sun, Jul 12, 2020 at 08:24:53AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> 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 <trix@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> 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 3540e4931383..da933d477e5f 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;
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: trix@redhat.com
Cc: a.hajda@samsung.com, narmstrong@baylibre.com, jonas@kwiboo.se,
jernej.skrabec@siol.net, airlied@linux.ie, daniel@ffwll.ch,
architt@codeaurora.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] drm/bridge: sil_sii8620: initialize return of sii8620_readb
Date: Sun, 12 Jul 2020 18:34:49 +0300 [thread overview]
Message-ID: <20200712153449.GA6642@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200712152453.27510-1-trix@redhat.com>
Hi Tom,
Thank you for the patch.
On Sun, Jul 12, 2020 at 08:24:53AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> 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 <trix@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> 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 3540e4931383..da933d477e5f 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;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2020-07-12 15:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200712152516eucas1p2cd883f7ccfcbfa78d452ba7a5641c363@eucas1p2.samsung.com>
2020-07-12 15:24 ` [PATCH] drm/bridge: sil_sii8620: initialize return of sii8620_readb trix
2020-07-12 15:24 ` trix
2020-07-12 15:34 ` Laurent Pinchart [this message]
2020-07-12 15:34 ` Laurent Pinchart
2020-07-13 15:29 ` Andrzej Hajda
2020-07-13 15:29 ` Andrzej Hajda
2020-07-13 16:00 ` Sam Ravnborg
2020-07-13 16:00 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200712153449.GA6642@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=architt@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=stable@vger.kernel.org \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.