Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63378673 authored by Daniel Thompson's avatar Daniel Thompson Committed by Lee Jones
Browse files

backlight: pwm_bl: Fix uninitialized variable



Currently, if the DT does not define num-interpolated-steps then
num_steps is undefined and the interpolation code will deploy randomly.
Fix with a simple initialize to zero.

Fixes: 573fe6d1 ("backlight: pwm_bl: Linear interpolation between brightness-levels")
Reported-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Tested-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 858c5dfc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ static int pwm_backlight_parse_dt(struct device *dev,
	struct device_node *node = dev->of_node;
	unsigned int num_levels = 0;
	unsigned int levels_count;
	unsigned int num_steps;
	unsigned int num_steps = 0;
	struct property *prop;
	unsigned int *table;
	int length;