Potential uninitialized variables in regulator: ltc3589

From: Yizhuo Zhai
Date: Fri Oct 04 2019 - 00:59:30 EST


Hi All:

drivers/regulator/ltc3589.c

Variable "irqstat" in function ltc3589_isr() 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 ltc3589_isr() because
the error code is out of the return type: irqreturn_t.

Thanks for your time to check this case.

--
Kind Regards,

Yizhuo Zhai

Computer Science, Graduate Student
University of California, Riverside