From owner-svn-src-projects@FreeBSD.ORG Mon Dec 17 00:06:21 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 487B9FD2; Mon, 17 Dec 2012 00:06:21 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CAB38FC0A; Mon, 17 Dec 2012 00:06:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBH06KUw078514; Mon, 17 Dec 2012 00:06:20 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBH06K0Y078513; Mon, 17 Dec 2012 00:06:20 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201212170006.qBH06K0Y078513@svn.freebsd.org> From: Bryan Venteicher Date: Mon, 17 Dec 2012 00:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244328 - projects/vmxnet/sys/dev/vmware/vmxnet X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2012 00:06:21 -0000 Author: bryanv Date: Mon Dec 17 00:06:20 2012 New Revision: 244328 URL: http://svnweb.freebsd.org/changeset/base/244328 Log: Fix mbuf leak in a very rare error case Approved by: grehan (implicit) Modified: projects/vmxnet/sys/dev/vmware/vmxnet/if_vic.c Modified: projects/vmxnet/sys/dev/vmware/vmxnet/if_vic.c ============================================================================== --- projects/vmxnet/sys/dev/vmware/vmxnet/if_vic.c Mon Dec 17 00:04:43 2012 (r244327) +++ projects/vmxnet/sys/dev/vmware/vmxnet/if_vic.c Mon Dec 17 00:06:20 2012 (r244328) @@ -1003,18 +1003,17 @@ vic_encap_load_mbuf(struct vic_softc *sc return (error); m = m_collapse(m, M_DONTWAIT, maxsegs); - if (m != NULL) + if (m != NULL) { + *m0 = m; error = bus_dmamap_load_mbuf_sg(tag, dmap, m, segs, nsegs, 0); - else + } else error = ENOBUFS; if (error) { m_freem(*m0); - m = NULL; + *m0 = NULL; } - *m0 = m; - return (error); }