diff options
author | Alexander Guller <alexg@mellanox.com> | 2011-10-09 05:29:35 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-10 03:42:58 (GMT) |
commit | 4234144f5ca69a0a13d5adae6c94b6937c52541f (patch) | |
tree | 14a815179c01cd3cb99fa42d2926ca58e7d87a62 /drivers/net/ethernet/mellanox/mlx4 | |
parent | 999bb4b3831abd6ad53023a0b8e5d304875927dd (diff) | |
download | linux-fsl-qoriq-4234144f5ca69a0a13d5adae6c94b6937c52541f.tar.xz |
mlx4_en: Fix crash upon device initialization error
Netdevice was being freed without being unregistered first if
mlx4_SET_PORT_general or mlx4_INIT_PORT failed.
Signed-off-by: Alexander Guller <alexg@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index b82db4a..c4c4be4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -1097,6 +1097,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, en_err(priv, "Netdev registration failed for port %d\n", port); goto out; } + priv->registered = 1; en_warn(priv, "Using %d TX rings\n", prof->tx_ring_num); en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num); @@ -1118,7 +1119,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, en_err(priv, "Failed Initializing port\n"); goto out; } - priv->registered = 1; mlx4_en_set_default_moderation(priv); queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); return 0; |