Skip to content

Commit abb5a5d

Browse files
Daniel Thompsonlag-linaro
authored andcommitted
backlight: lm3639: Fully initialize backlight_properties during probe
props is stack allocated and the fields that are not explcitly set by the probe function need to be zeroed or we'll get undefined behaviour (especially so power/blank states)! Fixes: 0f59858 ("backlight: add new lm3639 backlight driver") Signed-off-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 0285e9e commit abb5a5d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/video/backlight/lm3639_bl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ static int lm3639_probe(struct i2c_client *client)
338338
}
339339

340340
/* backlight */
341+
memset(&props, 0, sizeof(struct backlight_properties));
341342
props.type = BACKLIGHT_RAW;
342343
props.brightness = pdata->init_brt_led;
343344
props.max_brightness = pdata->max_brt_led;

0 commit comments

Comments
 (0)