Thread (2 messages) 2 messages, 2 authors, 2023-11-28

Re: [PATCH] backlight: mp3309c: fix uninitialized local variable

From: Daniel Thompson <hidden>
Date: 2023-11-28 18:10:18
Also in: dri-devel, lkml

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help