diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2021-03-04 18:06:48 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-05 12:59:32 -0800 |
commit | 38c26ff3048af50eee3fcd591921357ee5bfd9ee (patch) | |
tree | 5da31f23db3ee8bd9cc38f2e5437dded4c851a0e /drivers/net | |
parent | 00ff801bb8ce6711e919af4530b6ffa14a22390a (diff) |
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')
-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); |