mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04: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 <[email protected]>
Signed-off-by: Daniel Thompson <[email protected]>
Tested-by: Marcel Ziswiler <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
This commit is contained in:
parent
858c5dfc8c
commit
633786736e
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue