backlight: pwm_bl: Fix uninitialized variable
authorDaniel Thompson <daniel.thompson@linaro.org>
Wed, 25 Jul 2018 07:38:30 +0000 (08:38 +0100)
committerLee Jones <lee.jones@linaro.org>
Wed, 25 Jul 2018 08:09:59 +0000 (09:09 +0100)
commit633786736ed53a53b8d0a630cc3ff57381027081
tree823842fd94484802c4965fa12ac9a057bd7cdb2f
parent858c5dfc8c336ca26b8d4d9f639a9dc40c5daa80
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: 573fe6d1c25c ("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>
drivers/video/backlight/pwm_bl.c