Skip to content

Commit 0285e9e

Browse files
Daniel Thompsonlag-linaro
authored andcommitted
backlight: da9052: 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: 6ede3d8 ("backlight: add driver for DA9052/53 PMIC v1") Signed-off-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent dc0ba74 commit 0285e9e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/video/backlight/da9052_bl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ static int da9052_backlight_probe(struct platform_device *pdev)
117117
wleds->led_reg = platform_get_device_id(pdev)->driver_data;
118118
wleds->state = DA9052_WLEDS_OFF;
119119

120+
memset(&props, 0, sizeof(struct backlight_properties));
120121
props.type = BACKLIGHT_RAW;
121122
props.max_brightness = DA9052_MAX_BRIGHTNESS;
122123

0 commit comments

Comments
 (0)