Skip to content

Commit

Permalink
backlight: lm3639: Fully initialize backlight_properties during probe
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
daniel-thompson authored and lag-linaro committed Mar 7, 2024
1 parent 0285e9e commit abb5a5d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/video/backlight/lm3639_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ static int lm3639_probe(struct i2c_client *client)
}

/* backlight */
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_RAW;
props.brightness = pdata->init_brt_led;
props.max_brightness = pdata->max_brt_led;
Expand Down

0 comments on commit abb5a5d

Please sign in to comment.