mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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: 573fe6d1c2
("backlight: pwm_bl: Linear interpolation between brightness-levels")
Reported-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
858c5dfc8c
commit
633786736e
@ -250,7 +250,7 @@ static int pwm_backlight_parse_dt(struct device *dev,
|
|||||||
struct device_node *node = dev->of_node;
|
struct device_node *node = dev->of_node;
|
||||||
unsigned int num_levels = 0;
|
unsigned int num_levels = 0;
|
||||||
unsigned int levels_count;
|
unsigned int levels_count;
|
||||||
unsigned int num_steps;
|
unsigned int num_steps = 0;
|
||||||
struct property *prop;
|
struct property *prop;
|
||||||
unsigned int *table;
|
unsigned int *table;
|
||||||
int length;
|
int length;
|
||||||
|
Loading…
Reference in New Issue
Block a user