From owner-svn-src-head@freebsd.org Thu Jan 12 16:24:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFBE6CACFE9; Thu, 12 Jan 2017 16:24:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF6181DF2; Thu, 12 Jan 2017 16:24:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0CGOAJ8049350; Thu, 12 Jan 2017 16:24:10 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CGOApg049349; Thu, 12 Jan 2017 16:24:10 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121624.v0CGOApg049349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 16:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311986 - head/sys/dev/netmap 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.23 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, 12 Jan 2017 16:24:12 -0000 Author: sbruno Date: Thu Jan 12 16:24:10 2017 New Revision: 311986 URL: https://svnweb.freebsd.org/changeset/base/311986 Log: Fix panic on mb_free_ext() due to NULL destructor. This used to happen because of the SET_MBUF_DESTRUCTOR() called on unregif. Submitted by: Vincenzo Maffione Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Thu Jan 12 16:22:28 2017 (r311985) +++ head/sys/dev/netmap/netmap_generic.c Thu Jan 12 16:24:10 2017 (r311986) @@ -165,12 +165,12 @@ nm_os_get_mbuf(struct ifnet *ifp, int le * has a KASSERT(), checking that the mbuf dtor function is not NULL. */ +static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } + #define SET_MBUF_DESTRUCTOR(m, fn) do { \ - (m)->m_ext.ext_free = (void *)fn; \ + (m)->m_ext.ext_free = fn ? (void *)fn : (void *)void_mbuf_dtor; \ } while (0) -static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } - static inline struct mbuf * nm_os_get_mbuf(struct ifnet *ifp, int len) {