Module Name: src
Committed By: snj
Date: Tue Apr 21 04:55:15 UTC 2015
Modified Files:
src/sys/dev/ic [netbsd-7]: bwi.c
src/sys/nfs [netbsd-7]: krpc_subr.c
Log Message:
Pull up following revision(s) (requested by maxv in ticket #713):
sys/dev/ic/bwi.c: revision 1.26
sys/nfs/krpc_subr.c: revision 1.38
Fix uninitialized variable.
Found by The Brainy Code Scanner in FreeBSD.
--
Fix a double free. "Suggested" by Brainy.
ok rjs@ riastradh@
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.4.1 src/sys/dev/ic/bwi.c
cvs rdiff -u -r1.37.38.1 -r1.37.38.2 src/sys/nfs/krpc_subr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/bwi.c
diff -u src/sys/dev/ic/bwi.c:1.24 src/sys/dev/ic/bwi.c:1.24.4.1
--- src/sys/dev/ic/bwi.c:1.24 Tue Feb 25 18:30:09 2014
+++ src/sys/dev/ic/bwi.c Tue Apr 21 04:55:15 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: bwi.c,v 1.24 2014/02/25 18:30:09 pooka Exp $ */
+/* $NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $ */
/* $OpenBSD: bwi.c,v 1.74 2008/02/25 21:13:30 mglocker Exp $ */
/*
@@ -48,7 +48,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24 2014/02/25 18:30:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -9140,7 +9140,6 @@ bwi_encap(struct bwi_softc *sc, int idx,
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
if (m_new == NULL) {
- m_freem(m);
error = ENOBUFS;
aprint_error_dev(sc->sc_dev,
"can't defrag TX buffer (1)\n");
@@ -9151,7 +9150,6 @@ bwi_encap(struct bwi_softc *sc, int idx,
if (m->m_pkthdr.len > MHLEN) {
MCLGET(m_new, M_DONTWAIT);
if (!(m_new->m_flags & M_EXT)) {
- m_freem(m);
m_freem(m_new);
error = ENOBUFS;
}
Index: src/sys/nfs/krpc_subr.c
diff -u src/sys/nfs/krpc_subr.c:1.37.38.1 src/sys/nfs/krpc_subr.c:1.37.38.2
--- src/sys/nfs/krpc_subr.c:1.37.38.1 Mon Apr 6 01:37:29 2015
+++ src/sys/nfs/krpc_subr.c Tue Apr 21 04:55:15 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: krpc_subr.c,v 1.37.38.1 2015/04/06 01:37:29 snj Exp $ */
+/* $NetBSD: krpc_subr.c,v 1.37.38.2 2015/04/21 04:55:15 snj Exp $ */
/*
* Copyright (c) 1995 Gordon Ross, Adam Glass
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: krpc_subr.c,v 1.37.38.1 2015/04/06 01:37:29 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: krpc_subr.c,v 1.37.38.2 2015/04/21 04:55:15 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -242,7 +242,7 @@ krpc_call(struct sockaddr_in *sa, u_int
* Create socket and set its receive timeout.
*/
if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, l, NULL)))
- goto out;
+ return error;
if ((error = nfs_boot_setrecvtimo(so)))
goto out;