]> git.baikalelectronics.ru Git - kernel.git/commit
net: hisilicon: Fix usage of uninitialized variable in function mdio_sc_cfg_reg_write()
authorYizhuo <yzhai003@ucr.edu>
Tue, 1 Oct 2019 20:24:39 +0000 (13:24 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Oct 2019 21:20:22 +0000 (14:20 -0700)
commit27d64b0a307729c1741cc6b6e6855324e180b2a1
tree6c4b3dc78e76a49211dbaa32253af4a98e7fc2e3
parent9ed558e29293d4d3f64493b33dde7bb235ad9a0c
net: hisilicon: Fix usage of uninitialized variable in function mdio_sc_cfg_reg_write()

In function mdio_sc_cfg_reg_write(), variable "reg_value" could be
uninitialized if regmap_read() fails. However, "reg_value" is used
to decide the control flow later in the if statement, which is
potentially unsafe.

Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns_mdio.c