All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Lee Jones" <lee@kernel.org>, "Jingoo Han" <jingoohan1@gmail.com>,
	"Helge Deller" <deller@gmx.de>,
	"Artur Weber" <aweber.kernel@gmail.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] backlight: lp855x: fix unintialized function return
Date: Mon, 14 Aug 2023 09:41:17 +0100	[thread overview]
Message-ID: <20230814084117.GD5056@aspen.lan> (raw)
In-Reply-To: <20230811131600.2380519-1-arnd@kernel.org>

On Fri, Aug 11, 2023 at 03:15:53PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The function now returns an error code in some cases, but fails to initialize
> it in others:
>
> drivers/video/backlight/lp855x_bl.c:252:11: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
>         else if (lp->mode == REGISTER_BASED)
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/video/backlight/lp855x_bl.c:256:9: note: uninitialized use occurs here
>         return ret;
>                ^~~
> drivers/video/backlight/lp855x_bl.c:252:7: note: remove the 'if' if its condition is always true
>         else if (lp->mode == REGISTER_BASED)
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Since this case should not actually happen, return the -EINVAL code.
>
> Fixes: 5145531be5fba ("backlight: lp855x: Catch errors when changing brightness")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I think we already received a patch for this:
https://lore.kernel.org/lkml/20230809163825.GA5056@aspen.lan/T/


Daniel.

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
	"Artur Weber" <aweber.kernel@gmail.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Helge Deller" <deller@gmx.de>, "Lee Jones" <lee@kernel.org>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH] backlight: lp855x: fix unintialized function return
Date: Mon, 14 Aug 2023 09:41:17 +0100	[thread overview]
Message-ID: <20230814084117.GD5056@aspen.lan> (raw)
In-Reply-To: <20230811131600.2380519-1-arnd@kernel.org>

On Fri, Aug 11, 2023 at 03:15:53PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The function now returns an error code in some cases, but fails to initialize
> it in others:
>
> drivers/video/backlight/lp855x_bl.c:252:11: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
>         else if (lp->mode == REGISTER_BASED)
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/video/backlight/lp855x_bl.c:256:9: note: uninitialized use occurs here
>         return ret;
>                ^~~
> drivers/video/backlight/lp855x_bl.c:252:7: note: remove the 'if' if its condition is always true
>         else if (lp->mode == REGISTER_BASED)
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Since this case should not actually happen, return the -EINVAL code.
>
> Fixes: 5145531be5fba ("backlight: lp855x: Catch errors when changing brightness")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I think we already received a patch for this:
https://lore.kernel.org/lkml/20230809163825.GA5056@aspen.lan/T/


Daniel.

  reply	other threads:[~2023-08-14  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11 13:15 [PATCH] backlight: lp855x: fix unintialized function return Arnd Bergmann
2023-08-11 13:15 ` Arnd Bergmann
2023-08-14  8:41 ` Daniel Thompson [this message]
2023-08-14  8:41   ` Daniel Thompson

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=20230814084117.GD5056@aspen.lan \
    --to=daniel.thompson@linaro.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=aweber.kernel@gmail.com \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.