2021-03-05 02:07:56

by Jia-Ju Bai

[permalink] [raw]
Subject: [PATCH] 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 <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
---
drivers/net/ethernet/tehuti/tehuti.c | 1 +
1 file changed, 1 insertion(+)

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);
--
2.17.1


2021-03-05 21:15:56

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: tehuti: fix error return code in bdx_probe()

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Thu, 4 Mar 2021 18:06:48 -0800 you wrote:
> 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 <[email protected]>
> Signed-off-by: Jia-Ju Bai <[email protected]>
>
> [...]

Here is the summary with links:
- net: tehuti: fix error return code in bdx_probe()
https://git.kernel.org/netdev/net/c/38c26ff3048a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html