diff mbox

rocker: fix error return code in rocker_probe()

Message ID 1429186862-20989-1-git-send-email-weiyj_lk@163.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

weiyj_lk@163.com April 16, 2015, 12:21 p.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return -EINVAL from the invalid PCI region size error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/rocker/rocker.c | 1 +
 1 file changed, 1 insertion(+)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jiri Pirko April 16, 2015, 12:47 p.m. UTC | #1
Thu, Apr 16, 2015 at 02:21:02PM CEST, weiyj_lk@163.com wrote:
>From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
>Fix to return -EINVAL from the invalid PCI region size error
>handling case instead of 0, as done elsewhere in this function.
>
>Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>


Good catch.

Acked-by: Jiri Pirko <jiri@resnulli.us>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller April 16, 2015, 4:13 p.m. UTC | #2
From: weiyj_lk@163.com
Date: Thu, 16 Apr 2015 20:21:02 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return -EINVAL from the invalid PCI region size error
> handling case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 5cecec2..0cc17f5 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4293,6 +4293,7 @@  static int rocker_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	if (pci_resource_len(pdev, 0) < ROCKER_PCI_BAR0_SIZE) {
 		dev_err(&pdev->dev, "invalid PCI region size\n");
+		err = -EINVAL;
 		goto err_pci_resource_len_check;
 	}