[Linux-stm32] Potential uninitialized variables in pwm: stm32-lp
Yizhuo Zhai
yzhai003 at ucr.edu
Fri Oct 4 04:52:31 UTC 2019
Hi All:
drivers/pwm/pwm-stm32-lp.c:
Variable "val" and "prd" in function stm32_pwm_lp_get_state() could be
uninitialized
if regmap_read() returns -EINVAL. But it's directly used later without
the return check,
which is potentially unsafe.
Also, we cannot simply return -EINVAL in stm32_pwm_lp_get_state() because the
return type is void.
Thanks for your time to check this case.
--
Kind Regards,
Yizhuo Zhai
Computer Science, Graduate Student
University of California, Riverside
More information about the Linux-stm32
mailing list