From 7ee6478d5aa957d796a18e8c0e63943b038acf58 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Tue, 20 Feb 2024 15:35:27 +0000 Subject: [PATCH] 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 Link: https://lore.kernel.org/r/20240220153532.76613-5-daniel.thompson@linaro.org Signed-off-by: Lee Jones --- drivers/video/backlight/mp3309c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index 708c053d492c0..c80a1481e742b 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -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; -- 2.30.2