Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Nov 2011 13:36:18 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Jaakko Heinonen <jh@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" <bz@FreeBSD.org>, src-committers@FreeBSD.org
Subject:   Re: svn commit: r228071 - head/sys/net
Message-ID:  <20111129093618.GA44498@FreeBSD.org>
In-Reply-To: <20111128202307.GA4064@jh>
References:  <201111281444.pASEixdO095604@svn.freebsd.org> <E15FE643-3360-4D42-8736-827104FDD128@FreeBSD.org> <20111128202307.GA4064@jh>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 28, 2011 at 10:23:07PM +0200, Jaakko Heinonen wrote:
J> On 2011-11-28, Bjoern A. Zeeb wrote:
J> > > static void
J> > > if_clone_free(struct if_clone *ifc)
J> > > {
J> > > -	for (int bytoff = 0; bytoff < ifc->ifc_bmlen; bytoff++) {
J> > > -		KASSERT(ifc->ifc_units[bytoff] == 0x00,
J> > > -		    ("ifc_units[%d] is not empty", bytoff));
J> > > -	}
J> > > 
J> > > 	KASSERT(LIST_EMPTY(&ifc->ifc_iflist),
J> > > 	    ("%s: ifc_iflist not empty", __func__));
J> > > 
J> > > 	IF_CLONE_LOCK_DESTROY(ifc);
J> > > -	free(ifc->ifc_units, M_CLONE);
J> > > +	delete_unrhdr(ifc->ifc_unrhdr);
J> > > }
J> 
J> delete_unrhdr() KASSERTs that all allocations has been freed. Thus if
J> the leak below has occurred, the result will be a panic at this point
J> with INVARIANTS enabled kernel. If INVARIANTS is disabled, a memory leak
J> is possible.

Thanks, Jaakko! Good catch. I will try to fix that.

-- 
Totus tuus, Glebius.



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