2014-12-30 08:05:42

by xuyongjiande

[permalink] [raw]
Subject: [PATCH] qlcnic: Fix return value in qlcnic_probe()

From: Yongjian Xu <[email protected]>

If the check of adapter fails and goes into the 'else' branch, the
return value 'err' should not still be zero.

Signed-off-by: Yongjian Xu <[email protected]>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 1aa25b1..a95b604 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2603,6 +2603,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} else {
dev_err(&pdev->dev,
"%s: failed. Please Reboot\n", __func__);
+ err = -ENODEV;
goto err_out_free_hw;
}

--
1.7.9.5


2014-12-30 08:45:49

by Shahed Shaikh

[permalink] [raw]
Subject: RE: [PATCH] qlcnic: Fix return value in qlcnic_probe()

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Tuesday, December 30, 2014 1:34 PM
> To: Shahed Shaikh; Dept-GE Linux NIC Dev
> Cc: netdev; linux-kernel; Yongjian Xu
> Subject: [PATCH] qlcnic: Fix return value in qlcnic_probe()
>
> From: Yongjian Xu <[email protected]>
>
> If the check of adapter fails and goes into the 'else' branch, the return value
> 'err' should not still be zero.
>
> Signed-off-by: Yongjian Xu <[email protected]>
> ---
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 +
> 1 file changed, 1 insertion(+)

Acked-by: Shahed Shaikh <[email protected]>

Thanks,
Shahed

2015-01-01 00:21:43

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] qlcnic: Fix return value in qlcnic_probe()

From: [email protected]
Date: Tue, 30 Dec 2014 16:03:46 +0800

> From: Yongjian Xu <[email protected]>
>
> If the check of adapter fails and goes into the 'else' branch, the
> return value 'err' should not still be zero.
>
> Signed-off-by: Yongjian Xu <[email protected]>

Applied, thank you.