2019-10-04 08:07:09

by Yizhuo Zhai

[permalink] [raw]
Subject: Potential uninitialized variables in subsys net: hisilicon

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