Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix resource free.

The order of releasing resources in mlxen was wrong, which caused
panic on reload of the module.

MFC: 256682

Submitted by:	Shahar Klein (shahark at mellanox.com)
Approved by:	 re
  • Loading branch information...
commit 514a2c2eaae634f1b2dfb3644838d92fa2916acb 1 parent b36ea75
Alfred Perlstein splbio authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 sys/ofed/drivers/net/mlx4/en_netdev.c
6 sys/ofed/drivers/net/mlx4/en_netdev.c
View
@@ -927,9 +927,6 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
if (priv->allocated)
mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE);
- if (priv->sysctl)
- sysctl_ctx_free(&priv->conf_ctx);
-
mutex_lock(&mdev->state_lock);
mlx4_en_stop_port(dev);
mutex_unlock(&mdev->state_lock);
@@ -946,6 +943,9 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
mlx4_en_free_resources(priv);
+ if (priv->sysctl)
+ sysctl_ctx_free(&priv->conf_ctx);
+
mtx_destroy(&priv->stats_lock.m);
mtx_destroy(&priv->vlan_lock.m);
kfree(priv);
Please sign in to comment.
Something went wrong with that request. Please try again.