[PATCH RESEND 4/4] backlight: mp3309c: Fully initialize backlight_properties during probe

Daniel Thompson posted 4 patches 1 year, 11 months ago
[PATCH RESEND 4/4] backlight: mp3309c: Fully initialize backlight_properties during probe
Posted by Daniel Thompson 1 year, 11 months ago
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 <daniel.thompson@linaro.org>
---
 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 34d71259fac1d..cdf302d6f1cb5 100644
--- a/drivers/video/backlight/mp3309c.c
+++ b/drivers/video/backlight/mp3309c.c
@@ -373,6 +373,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.43.0
Re: (subset) [PATCH RESEND 4/4] backlight: mp3309c: Fully initialize backlight_properties during probe
Posted by Lee Jones 1 year, 11 months ago
On Tue, 20 Feb 2024 15:35:27 +0000, Daniel Thompson wrote:
> 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.
> 
> 

Applied, thanks!

[4/4] backlight: mp3309c: Fully initialize backlight_properties during probe
      commit: 50a2c0aee92699ed47076636b652f9d27a20fbef

--
Lee Jones [李琼斯]