Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 2013 12:19:36 +0000 (UTC)
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256682 - head/sys/ofed/drivers/net/mlx4
Message-ID:  <201310171219.r9HCJaXx062118@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alfred
Date: Thu Oct 17 12:19:36 2013
New Revision: 256682
URL: http://svnweb.freebsd.org/changeset/base/256682

Log:
  Fix resource free.
  
  The order of releasing resources in mlxen was wrong, which caused
  panic on reload of the module.
  
  conf_ctx list should be released before stat_ctx list, otherwise
  the leafs in conf_ctx list won't be released because of the dependancy.
  
  The fix is to change the order of the releases.
  
  Submitted by:	Shahar Klein (shahark at mellanox.com)

Modified:
  head/sys/ofed/drivers/net/mlx4/en_netdev.c

Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_netdev.c	Thu Oct 17 12:15:21 2013	(r256681)
+++ head/sys/ofed/drivers/net/mlx4/en_netdev.c	Thu Oct 17 12:19:36 2013	(r256682)
@@ -927,9 +927,6 @@ void mlx4_en_destroy_netdev(struct net_d
 	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_d
 
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310171219.r9HCJaXx062118>