Skip to content

Commit b82d71c

Browse files
ZheyuMadavem330
authored andcommitted
net: chelsio: cxgb4vf: Fix an error code in cxgb4vf_pci_probe()
During the process of driver probing, probe function should return < 0 for failure, otherwise kernel will treat value == 0 as success. Therefore, we should set err to -EINVAL when adapter->registered_device_map is NULL. Otherwise kernel will assume that driver has been successfully probed and will cause unexpected errors. Signed-off-by: Zheyu Ma <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c75a9ad commit b82d71c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3196,6 +3196,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
31963196
}
31973197
if (adapter->registered_device_map == 0) {
31983198
dev_err(&pdev->dev, "could not register any net devices\n");
3199+
err = -EINVAL;
31993200
goto err_disable_interrupts;
32003201
}
32013202

0 commit comments

Comments
 (0)