lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230814084117.GD5056@aspen.lan>
Date:   Mon, 14 Aug 2023 09:41:17 +0100
From:   Daniel Thompson <daniel.thompson@...aro.org>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Lee Jones <lee@...nel.org>, Jingoo Han <jingoohan1@...il.com>,
        Helge Deller <deller@....de>,
        Artur Weber <aweber.kernel@...il.com>,
        Arnd Bergmann <arnd@...db.de>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Benjamin Mugnier <benjamin.mugnier@...s.st.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] backlight: lp855x: fix unintialized function return

On Fri, Aug 11, 2023 at 03:15:53PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.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@...db.de>

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


Daniel.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ