Thread (17 messages) 17 messages, 5 authors, 2024-05-28

Re: [PATCH 1/4] backlight: lm3630a: Initialize backlight_properties on init

From: Konrad Dybcio <hidden>
Date: 2024-02-20 14:07:59
Also in: dri-devel, linux-arm-msm, linux-devicetree, lkml, phone-devel

On 20.02.2024 00:11, Luca Weiss wrote:
quoted hunk ↗ jump to hunk
The backlight_properties struct should be initialized to zero before
using, otherwise there will be some random values in the struct.

Fixes: 0c2a665a648e ("backlight: add Backlight driver for lm3630 chip")
Signed-off-by: Luca Weiss <redacted>
---
 drivers/video/backlight/lm3630a_bl.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
index a3412c936ca2..8e275275b808 100644
--- a/drivers/video/backlight/lm3630a_bl.c
+++ b/drivers/video/backlight/lm3630a_bl.c
@@ -343,6 +343,7 @@ static int lm3630a_backlight_register(struct lm3630a_chip *pchip)
 	struct backlight_properties props;
 	const char *label;
 
+	memset(&props, 0, sizeof(struct backlight_properties));
You can zero-initialize it instead

Konrad
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help