From owner-svn-src-all@freebsd.org Sun Jul 19 18:05:50 2015 Return-Path: Delivered-To: svn-src-all@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 D582D9A662B; Sun, 19 Jul 2015 18:05:50 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C615B1945; Sun, 19 Jul 2015 18:05:50 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JI5od5095580; Sun, 19 Jul 2015 18:05:50 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JI5oug095579; Sun, 19 Jul 2015 18:05:50 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201507191805.t6JI5oug095579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 19 Jul 2015 18:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285697 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 18:05:50 -0000 Author: luigi Date: Sun Jul 19 18:05:49 2015 New Revision: 285697 URL: https://svnweb.freebsd.org/changeset/base/285697 Log: do not free NULL if pipe allocation fails Modified: head/sys/dev/netmap/netmap_pipe.c Modified: head/sys/dev/netmap/netmap_pipe.c ============================================================================== --- head/sys/dev/netmap/netmap_pipe.c Sun Jul 19 18:04:51 2015 (r285696) +++ head/sys/dev/netmap/netmap_pipe.c Sun Jul 19 18:05:49 2015 (r285697) @@ -616,7 +616,7 @@ netmap_get_pipe_na(struct nmreq *nmr, st sna = malloc(sizeof(*mna), M_DEVBUF, M_NOWAIT | M_ZERO); if (sna == NULL) { error = ENOMEM; - goto free_mna; + goto unregister_mna; } /* most fields are the same, copy from master and then fix */ *sna = *mna; @@ -666,6 +666,8 @@ found: free_sna: free(sna, M_DEVBUF); +unregister_mna: + netmap_pipe_remove(pna, mna); free_mna: free(mna, M_DEVBUF); put_out: