Commit df4770de authored by Eilon Greenstein's avatar Eilon Greenstein Committed by David S. Miller

bnx2x: Calling pci_set_drvdata earlier

In case of error, bnx2x_init_dev calls pci_set_drvdata(pdev, NULL)
Signed-off-by: default avatarYitchak Gertner <gertner@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a18f5128
......@@ -11885,14 +11885,14 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
bp = netdev_priv(dev);
bp->msglevel = debug;
pci_set_drvdata(pdev, dev);
rc = bnx2x_init_dev(pdev, dev);
if (rc < 0) {
free_netdev(dev);
return rc;
}
pci_set_drvdata(pdev, dev);
rc = bnx2x_init_bp(bp);
if (rc)
goto init_one_exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment