diff mbox series

[net-next] net: aquantia: Fix error return code in aq_pci_probe()

Message ID 1516673446-170729-1-git-send-email-weiyongjun1@huawei.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net-next] net: aquantia: Fix error return code in aq_pci_probe() | expand

Commit Message

Wei Yongjun Jan. 23, 2018, 2:10 a.m. UTC
Fix to return error code -ENOMEM from the aq_ndev_alloc() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Igor Russkikh Jan. 23, 2018, 7:14 a.m. UTC | #1
> Fix to return error code -ENOMEM from the aq_ndev_alloc() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Igor Russkikh <igor.russkikh@aquantia.com>
David Miller Jan. 23, 2018, 4 p.m. UTC | #2
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Tue, 23 Jan 2018 02:10:46 +0000

> Fix to return error code -ENOMEM from the aq_ndev_alloc() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
index f5dd5f7..5cf3542 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
@@ -210,8 +210,10 @@  static int aq_pci_probe(struct pci_dev *pdev,
 		goto err_pci_func;
 
 	ndev = aq_ndev_alloc();
-	if (!ndev)
+	if (!ndev) {
+		err = -ENOMEM;
 		goto err_ndev;
+	}
 
 	self = netdev_priv(ndev);
 	self->pdev = pdev;