diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-08-12 04:23:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-13 02:02:45 -0400 |
commit | df4770de03d2eec3f66b0ac4d2248d471a1ccc0b (patch) | |
tree | 42165fc7574dc1e05ae6663be31b7891c5ff471f /drivers/net/bnx2x_main.c | |
parent | a18f5128828cd1af8091602f5233b00422e74c9a (diff) |
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>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 0ebbc7794803..8e77e933ac18 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -11885,14 +11885,14 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
11885 | bp = netdev_priv(dev); | 11885 | bp = netdev_priv(dev); |
11886 | bp->msglevel = debug; | 11886 | bp->msglevel = debug; |
11887 | 11887 | ||
11888 | pci_set_drvdata(pdev, dev); | ||
11889 | |||
11888 | rc = bnx2x_init_dev(pdev, dev); | 11890 | rc = bnx2x_init_dev(pdev, dev); |
11889 | if (rc < 0) { | 11891 | if (rc < 0) { |
11890 | free_netdev(dev); | 11892 | free_netdev(dev); |
11891 | return rc; | 11893 | return rc; |
11892 | } | 11894 | } |
11893 | 11895 | ||
11894 | pci_set_drvdata(pdev, dev); | ||
11895 | |||
11896 | rc = bnx2x_init_bp(bp); | 11896 | rc = bnx2x_init_bp(bp); |
11897 | if (rc) | 11897 | if (rc) |
11898 | goto init_one_exit; | 11898 | goto init_one_exit; |