From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Date: Wed, 25 Jul 2018 08:03:55 +0000 Subject: Re: [PATCH v4] backlight: pwm_bl: Fix uninitialized variable Message-Id: <20180725080355.GC5835@dell> List-Id: References: <20180716210241.9457-1-daniel.thompson@linaro.org> <20180725073830.31421-1-daniel.thompson@linaro.org> In-Reply-To: <20180725073830.31421-1-daniel.thompson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Daniel Thompson Cc: Jingoo Han , Thierry Reding , Bartlomiej Zolnierkiewicz , Marcel Ziswiler , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, patches@linaro.org On Wed, 25 Jul 2018, Daniel Thompson wrote: > 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 > Signed-off-by: Daniel Thompson > Tested-by: Marcel Ziswiler > Reviewed-by: Douglas Anderson > Acked-by: Lee Jones > --- > > Notes: > v4: > - Remove line break from Fixes: and update the *-by:s > > v3: > - Switch to the simplest fix and zero the uninitialized variable. git > grep indicates that ~25% of calls to of_property_read_u32() use this > pattern (pre-initialize optional properties with sane values and > ignore the return code). > > v2: > - Simplify SoB chain (with Marcel's permission) > - Separate complex if statement and make other similar calls use same > return code checking approach > - Tidy up comment formatting and fix pre-existing grammar error > > drivers/video/backlight/pwm_bl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog