bnx2x: Calling pci_set_drvdata earlier
In case of error, bnx2x_init_dev calls pci_set_drvdata(pdev, NULL) Signed-off-by: Yitchak Gertner <gertner@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
a18f512882
commit
df4770de03
@@ -11885,14 +11885,14 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
|
|||||||
bp = netdev_priv(dev);
|
bp = netdev_priv(dev);
|
||||||
bp->msglevel = debug;
|
bp->msglevel = debug;
|
||||||
|
|
||||||
|
pci_set_drvdata(pdev, dev);
|
||||||
|
|
||||||
rc = bnx2x_init_dev(pdev, dev);
|
rc = bnx2x_init_dev(pdev, dev);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
free_netdev(dev);
|
free_netdev(dev);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
pci_set_drvdata(pdev, dev);
|
|
||||||
|
|
||||||
rc = bnx2x_init_bp(bp);
|
rc = bnx2x_init_bp(bp);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto init_one_exit;
|
goto init_one_exit;
|
||||||
|
Reference in New Issue
Block a user