rocker: fix error return code in rocker_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 16 Apr 2015 12:21:02 +0000 (20:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Apr 2015 16:13:39 +0000 (12:13 -0400)
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>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/rocker/rocker.c

index a87b177bd7234a2610b7183a0a221241575a35b1..a570a60533be5531c5881ace3683e69e9d80ece5 100644 (file)
@@ -4759,6 +4759,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;
        }