# \[PATCH\] backlight: lp855x: Make sure props struct is zeroed

- Subsystems: FRAMEBUFFER LAYER, BACKLIGHT CLASS/SUBSYSTEM, THE REST
- Maintainers: Helge Deller, Lee Jones, Daniel Thompson, Jingoo Han, Linus Torvalds
- List: linux-fbdev
- 4 messages, 4 authors
- Page: https://ratatoskr.run/linux-fbdev/2015/08/4565507/t

## \[PATCH\] backlight: lp855x: Make sure props struct is zeroed

- From: Bjorn Andersson \<hidden\>
- Date: 2015-08-27 17:41:21 
- Message: https://ratatoskr.run/linux-fbdev/2015/08/4565507.md

```text
From: Werner Johansson <redacted>

The driver occasionally got stuck in suspend mode or other strange
states as those parts of the props struct were never initialized.

Signed-off-by: Werner Johansson <redacted>
Signed-off-by: Bjorn Andersson <redacted>
---
 drivers/video/backlight/lp855x_bl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index 88116b493f3b..0a7f88ce1ab0 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -282,6 +282,7 @@ static int lp855x_backlight_register(struct lp855x *lp)
 	struct lp855x_platform_data *pdata = lp->pdata;
 	const char *name = pdata->name ? : DEFAULT_BL_NAME;
 
+	memset(&props, 0, sizeof(props));
 	props.type = BACKLIGHT_PLATFORM;
 	props.max_brightness = MAX_BRIGHTNESS;
 
-- 
1.8.2.2

```

## Re: \[PATCH\] backlight: lp855x: Make sure props struct is zeroed

- From: Kim, Milo \<hidden\>
- Date: 2015-08-27 22:44:30 
- Message: https://ratatoskr.run/linux-fbdev/2015/08/4565744.md

```text
On 8/28/2015 2:41 AM, Bjorn Andersson wrote:
> From: Werner Johansson <redacted>
>
> The driver occasionally got stuck in suspend mode or other strange
> states as those parts of the props struct were never initialized.

Acked-by: Milo Kim <redacted>

Thanks for catching this.
```

## RE: \[PATCH\] backlight: lp855x: Make sure props struct is zeroed

- From: Johansson, Werner \<hidden\>
- Date: 2015-08-27 22:51:42 
- Message: https://ratatoskr.run/linux-fbdev/2015/08/4565747.md

```text
> > From: Werner Johansson <redacted>
> >
> > The driver occasionally got stuck in suspend mode or other strange
> > states as those parts of the props struct were never initialized.
> 
> Acked-by: Milo Kim <redacted>
> 
> Thanks for catching this.

You're most welcome! These issues can be difficult to track down, the stack is unpredictable.. 

/wj 
```

## Re: \[PATCH\] backlight: lp855x: Make sure props struct is zeroed

- From: Lee Jones \<hidden\>
- Date: 2015-09-19 10:06:34 
- Message: https://ratatoskr.run/linux-fbdev/2015/09/4579221.md

```text
On Thu, 27 Aug 2015, Bjorn Andersson wrote:

> From: Werner Johansson <redacted>
> 
> The driver occasionally got stuck in suspend mode or other strange
> states as those parts of the props struct were never initialized.
> 
> Signed-off-by: Werner Johansson <redacted>
> Signed-off-by: Bjorn Andersson <redacted>
> ---
>  drivers/video/backlight/lp855x_bl.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index 88116b493f3b..0a7f88ce1ab0 100644
> --- a/drivers/video/backlight/lp855x_bl.c
> +++ b/drivers/video/backlight/lp855x_bl.c
> @@ -282,6 +282,7 @@ static int lp855x_backlight_register(struct lp855x *lp)
>  	struct lp855x_platform_data *pdata = lp->pdata;
>  	const char *name = pdata->name ? : DEFAULT_BL_NAME;
>  
> +	memset(&props, 0, sizeof(props));
>  	props.type = BACKLIGHT_PLATFORM;
>  	props.max_brightness = MAX_BRIGHTNESS;
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org â”‚ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
```
