net: aquantia: Fix error return code in aq_pci_probe()

Fix to return error code -ENOMEM from the aq_ndev_alloc() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 23ee07ad3c ("net: aquantia: Cleanup pci functions module")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Wei Yongjun 2018-01-23 02:10:46 +00:00 committed by David S. Miller
parent e58decc9c5
commit f03e4f8aad
1 changed files with 3 additions and 1 deletions

View File

@ -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;