]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: bnx2: Fix error return code in bnx2_init_board()
authorZhen Lei <thunder.leizhen@huawei.com>
Sat, 15 May 2021 07:16:05 +0000 (15:16 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 May 2021 20:57:09 +0000 (13:57 -0700)
Fix to return -EPERM from the error handling case instead of 0, as done
elsewhere in this function.

Fixes: b6016b767397 ("[BNX2]: New Broadcom gigabit network driver.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2.c

index c0986096c701d368952ae3a8148e0a045ed89be1..5bace8a93d73be50d79f5da89abb2946998b9540 100644 (file)
@@ -8247,9 +8247,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
                BNX2_WR(bp, PCI_COMMAND, reg);
        } else if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1) &&
                !(bp->flags & BNX2_FLAG_PCIX)) {
-
                dev_err(&pdev->dev,
                        "5706 A1 can only be used in a PCIX bus, aborting\n");
+               rc = -EPERM;
                goto err_out_unmap;
        }