Skip to content

Commit

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

/* Backlight properties */
memset(&props, 0, sizeof(struct backlight_properties));
props.brightness = pdata->default_brightness;
props.max_brightness = pdata->max_brightness;
props.scale = BACKLIGHT_SCALE_LINEAR;
Expand Down

0 comments on commit 7ee6478

Please sign in to comment.