Date: Sun, 19 Jul 2015 18:05:50 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285697 - head/sys/dev/netmap Message-ID: <201507191805.t6JI5oug095579@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507191805.t6JI5oug095579>