Potential uninitialized variables in subsys net: hisilicon

From: Yizhuo Zhai
Date: Thu Oct 03 2019 - 23:36:00 EST


Hi All:

drivers/net/ethernet/hisilicon/hip04_eth.c:

In function hip04_reset_ppe(), variable "val" could be uninitialized
if regmap_read() returns -EINVAL. However, "val" is used to decide
the control flow, which is potentially unsafe.

Also, we cannot simply return -EINVAL in hip04_reset_ppe() 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