2023-11-29 16:53:19

by Daniel Thompson

[permalink] [raw]
Subject: Re: [PATCH v2] backlight: mp3309c: fix uninitialized local variable

On Wed, Nov 29, 2023 at 05:45:14PM +0100, Flavio Suligoi wrote:
> In the function "pm3309c_parse_dt_node", when the dimming analog control
> mode (by I2C messages) is enabled, the local variable "prop_levels" is
> tested without any initialization, as indicated by the following smatch
> warning:
>
> drivers/video/backlight/mp3309c.c:279 pm3309c_parse_dt_node() error: uninitialized symbol 'prop_levels'.
>
> To avoid any problem in case of undefined behavior, we need to initialize
> it to "NULL".
>
> Reported-by: Dan Carpenter <[email protected]>
> Closes: https://lore.kernel.org/dri-devel/[email protected]/
> Fixes: 2e914516a58c ("backlight: mp3309c: Add support for MPS MP3309C")
> Signed-off-by: Flavio Suligoi <[email protected]>

Reviewed-by: Daniel Thompson <[email protected]>


Daniel.