author | Yizhuo <yzhai003@ucr.edu> | |
Tue, 1 Oct 2019 20:24:39 +0000 (13:24 -0700) | ||
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
Sun, 27 Oct 2019 20:30:24 +0000 (21:30 +0100) | ||
commit | df87ebaa3da3ee446a7af1dfd6abb85cf0bc98d2 | |
tree | 84774170d822e67a0c5969958051a96ea60e2727 | tree | snapshot (tar.xz tar.gz zip) |
parent | b9d497ee416b4b42d4440b07a347f60baa2a2ee9 | commit | diff |
net: hisilicon: Fix usage of uninitialized variable in function mdio_sc_cfg_reg_write()
[ Upstream commit 53de429f4e88f538f7a8ec2b18be8c0cd9b2c8e1 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 53de429f4e88f538f7a8ec2b18be8c0cd9b2c8e1 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns_mdio.c | diff | blob | history |