提交 df4770de 编写于 作者: E Eilon Greenstein 提交者: 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: NYitchak Gertner <gertner@broadcom.com>
Signed-off-by: NEilon Greenstein <eilong@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a18f5128
...@@ -11885,14 +11885,14 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册