diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2021-03-05 05:06:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-05 23:59:32 +0300 |
commit | 38c26ff3048af50eee3fcd591921357ee5bfd9ee (patch) | |
tree | 5da31f23db3ee8bd9cc38f2e5437dded4c851a0e /drivers/net/ethernet/tehuti/tehuti.c | |
parent | 00ff801bb8ce6711e919af4530b6ffa14a22390a (diff) | |
download | linux-38c26ff3048af50eee3fcd591921357ee5bfd9ee.tar.xz |
net: tehuti: fix error return code in bdx_probe()
When bdx_read_mac() fails, no error return code of bdx_probe()
is assigned.
To fix this bug, err is assigned with -EFAULT as error return code.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/tehuti/tehuti.c')
-rw-r--r-- | drivers/net/ethernet/tehuti/tehuti.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c index b8f4f419173f..d054c6e83b1c 100644 --- a/drivers/net/ethernet/tehuti/tehuti.c +++ b/drivers/net/ethernet/tehuti/tehuti.c @@ -2044,6 +2044,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /*bdx_hw_reset(priv); */ if (bdx_read_mac(priv)) { pr_err("load MAC address failed\n"); + err = -EFAULT; goto err_out_iomap; } SET_NETDEV_DEV(ndev, &pdev->dev); |