[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231128181007.GA4431@aspen.lan>
Date: Tue, 28 Nov 2023 13:10:07 -0500
From: Daniel Thompson <daniel.thompson@...aro.org>
To: Flavio Suligoi <f.suligoi@...m.it>
Cc: Lee Jones <lee@...nel.org>, Jingoo Han <jingoohan1@...il.com>,
Helge Deller <deller@....de>,
Dan Carpenter <dan.carpenter@...aro.org>,
dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] backlight: mp3309c: fix uninitialized local variable
On Tue, Nov 28, 2023 at 04:08:39PM +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 (thanks to Dan Carpenter for the report):
Good to see credit for the reporter but please use a "Reported-by:" tag
for that. There should probably be a "Fixed:" tag too.
> 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".
> For consistency, I also initialize the other similar variable
> "prop_pwms" in the same way.
I don't love redundant initializations... but I can live with it ;-) .
Daniel.
Powered by blists - more mailing lists