From owner-svn-src-head@FreeBSD.ORG Thu Oct 17 12:19:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92ACC1F3; Thu, 17 Oct 2013 12:19:36 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 807B12AA8; Thu, 17 Oct 2013 12:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9HCJaMd062119; Thu, 17 Oct 2013 12:19:36 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9HCJaXx062118; Thu, 17 Oct 2013 12:19:36 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310171219.r9HCJaXx062118@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 17 Oct 2013 12:19:36 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2013 12:19:36 -0000 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);