Skip to content

Commit 7ee6478

Browse files
Daniel Thompsonlag-linaro
authored andcommitted
backlight: mp3309c: Fully initialize backlight_properties during probe
props is stack allocated and, although this driver initializes all the fields that are not "owned" by the framework, we'd still like to ensure it is zeroed to avoid problems from this driver if the fields change. Signed-off-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent d37831e commit 7ee6478

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/video/backlight/mp3309c.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ static int mp3309c_probe(struct i2c_client *client)
357357
chip->pdata = pdata;
358358

359359
/* Backlight properties */
360+
memset(&props, 0, sizeof(struct backlight_properties));
360361
props.brightness = pdata->default_brightness;
361362
props.max_brightness = pdata->max_brightness;
362363
props.scale = BACKLIGHT_SCALE_LINEAR;

0 commit comments

Comments
 (0)