Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys Pull up following revision(s) (requested by maxv in t...
details: https://anonhg.NetBSD.org/src/rev/103462fea50a
branches: netbsd-7
changeset: 798992:103462fea50a
user: martin <martin%NetBSD.org@localhost>
date: Mon Feb 16 21:25:34 2015 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #520):
sys/ufs/chfs/ebh.c: revision 1.6
sys/dev/sdmmc/sdmmc_mem.c: revision 1.33
sys/dev/ic/aic7xxx.c: revision 1.132
sys/fs/nfs/common/krpc_subr.c: revision 1.2
sys/modules/lua/lua.c: revision 1.16
sys/fs/udf/udf_subr.c: revision 1.128
sys/ufs/chfs/chfs_scan.c: revision 1.6
sys/dev/ic/an.c: revision 1.62
Fix six memory leaks and two inconsistencies.
diffstat:
sys/dev/ic/aic7xxx.c | 10 ++++++----
sys/dev/ic/an.c | 12 ++++++------
sys/dev/sdmmc/sdmmc_mem.c | 8 ++++----
sys/fs/nfs/common/krpc_subr.c | 7 ++++---
sys/fs/udf/udf_subr.c | 7 ++++---
sys/modules/lua/lua.c | 6 ++++--
sys/ufs/chfs/chfs_scan.c | 3 ++-
sys/ufs/chfs/ebh.c | 6 ++++--
8 files changed, 34 insertions(+), 25 deletions(-)
diffs (235 lines):
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/dev/ic/aic7xxx.c Mon Feb 16 21:25:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aic7xxx.c,v 1.131 2014/03/27 18:28:26 christos Exp $ */
+/* $NetBSD: aic7xxx.c,v 1.131.4.1 2015/02/16 21:25:34 martin Exp $ */
/*
* Core routines and tables shareable across OS platforms.
@@ -39,7 +39,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: aic7xxx.c,v 1.131 2014/03/27 18:28:26 christos Exp $
+ * $Id: aic7xxx.c,v 1.131.4.1 2015/02/16 21:25:34 martin Exp $
*
* //depot/aic7xxx/aic7xxx/aic7xxx.c#112 $
*
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.131 2014/03/27 18:28:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.131.4.1 2015/02/16 21:25:34 martin Exp $");
#include <dev/ic/aic7xxx_osm.h>
#include <dev/ic/aic7xxx_inline.h>
@@ -4372,8 +4372,10 @@
AHC_MAXTRANSFER_SIZE, AHC_NSEG, MAXPHYS, 0,
BUS_DMA_WAITOK|BUS_DMA_ALLOCNOW|ahc->sc_dmaflags,
&next_scb->dmamap);
- if (error != 0)
+ if (error != 0) {
+ free(pdata, M_DEVBUF);
break;
+ }
next_scb->hscb = &scb_data->hscbs[scb_data->numscbs];
next_scb->hscb->tag = ahc->scb_data->numscbs;
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/dev/ic/an.c
--- a/sys/dev/ic/an.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/dev/ic/an.c Mon Feb 16 21:25:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: an.c,v 1.61 2014/02/25 18:30:09 pooka Exp $ */
+/* $NetBSD: an.c,v 1.61.4.1 2015/02/16 21:25:34 martin Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul%ctr.columbia.edu@localhost>. All rights reserved.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.61 2014/02/25 18:30:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.61.4.1 2015/02/16 21:25:34 martin Exp $");
#include <sys/param.h>
@@ -569,8 +569,8 @@
if (ic->ic_des_esslen)
memcpy(sc->sc_buf.sc_ssidlist.an_entry[0].an_ssid,
ic->ic_des_essid, ic->ic_des_esslen);
- if (an_write_rid(sc, AN_RID_SSIDLIST, &sc->sc_buf,
- sizeof(sc->sc_buf.sc_ssidlist)) != 0) {
+ if ((error = an_write_rid(sc, AN_RID_SSIDLIST, &sc->sc_buf,
+ sizeof(sc->sc_buf.sc_ssidlist))) != 0) {
printf("%s: failed to write ssid list\n", ifp->if_xname);
an_stop(ifp, 1);
return error;
@@ -604,8 +604,8 @@
printf("\n");
}
#endif
- if (an_write_rid(sc, AN_RID_GENCONFIG, &sc->sc_config,
- sizeof(sc->sc_config)) != 0) {
+ if ((error = an_write_rid(sc, AN_RID_GENCONFIG, &sc->sc_config,
+ sizeof(sc->sc_config))) != 0) {
printf("%s: failed to write config\n", ifp->if_xname);
an_stop(ifp, 1);
return error;
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/dev/sdmmc/sdmmc_mem.c
--- a/sys/dev/sdmmc/sdmmc_mem.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/dev/sdmmc/sdmmc_mem.c Mon Feb 16 21:25:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdmmc_mem.c,v 1.31 2014/03/19 15:26:42 nonaka Exp $ */
+/* $NetBSD: sdmmc_mem.c,v 1.31.4.1 2015/02/16 21:25:34 martin Exp $ */
/* $OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $ */
/*
@@ -45,7 +45,7 @@
/* Routines for SD/MMC memory cards. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.31 2014/03/19 15:26:42 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.31.4.1 2015/02/16 21:25:34 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -741,7 +741,7 @@
aprint_error_dev(sc->sc_dev,
"unrecognised future version (%d)\n",
ext_csd[EXT_CSD_STRUCTURE]);
- return error;
+ return ENOTSUP;
}
hs_timing = 0;
switch (ext_csd[EXT_CSD_CARD_TYPE]) {
@@ -761,7 +761,7 @@
aprint_error_dev(sc->sc_dev,
"unknown CARD_TYPE: 0x%x\n",
ext_csd[EXT_CSD_CARD_TYPE]);
- return error;
+ return ENOTSUP;
}
if (!ISSET(sc->sc_caps, SMC_CAPS_MMC_HIGHSPEED)) {
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/fs/nfs/common/krpc_subr.c
--- a/sys/fs/nfs/common/krpc_subr.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/fs/nfs/common/krpc_subr.c Mon Feb 16 21:25:34 2015 +0000
@@ -44,7 +44,7 @@
#include <sys/cdefs.h>
/* __FBSDID("FreeBSD: head/sys/nfs/krpc_subr.c 248207 2013-03-12 13:42:47Z glebius "); */
-__RCSID("$NetBSD: krpc_subr.c,v 1.1.1.1 2013/09/30 07:19:32 dholland Exp $");
+__RCSID("$NetBSD: krpc_subr.c,v 1.1.1.1.8.1 2015/02/16 21:25:34 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -169,7 +169,7 @@
error = krpc_call(sin, PMAPPROG, PMAPVERS,
PMAPPROC_GETPORT, &m, NULL, td);
if (error)
- return error;
+ goto out;
if (m->m_len < sizeof(*rdata)) {
m = m_pullup(m, sizeof(*rdata));
@@ -179,8 +179,9 @@
rdata = mtod(m, struct rdata *);
*portp = rdata->port;
+out:
m_freem(m);
- return 0;
+ return error;
}
/*
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/fs/udf/udf_subr.c
--- a/sys/fs/udf/udf_subr.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/fs/udf/udf_subr.c Mon Feb 16 21:25:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.125 2014/07/29 15:36:43 reinoud Exp $ */
+/* $NetBSD: udf_subr.c,v 1.125.2.1 2015/02/16 21:25:35 martin Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.125 2014/07/29 15:36:43 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.125.2.1 2015/02/16 21:25:35 martin Exp $");
#endif /* not lint */
@@ -5334,8 +5334,9 @@
/* always return locked vnode */
if ((error = vn_lock(nvp, LK_EXCLUSIVE | LK_RETRY))) {
- /* recycle vnode and unlock; simultanious will fail too */
+ /* recycle vnode and unlock; simultaneous will fail too */
ungetnewvnode(nvp);
+ pool_put(&udf_node_pool, udf_node);
mutex_exit(&ump->get_node_lock);
return error;
}
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/modules/lua/lua.c
--- a/sys/modules/lua/lua.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/modules/lua/lua.c Mon Feb 16 21:25:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lua.c,v 1.13.2.1 2014/12/01 13:13:15 martin Exp $ */
+/* $NetBSD: lua.c,v 1.13.2.2 2015/02/16 21:25:35 martin Exp $ */
/*
* Copyright (c) 2014 by Lourival Vieira Neto <lneto%NetBSD.org@localhost>.
@@ -653,8 +653,10 @@
sc->sc_state = true;
mutex_exit(&sc->sc_state_lock);
- if (error)
+ if (error) {
+ kmem_free(s, sizeof(struct lua_state));
return NULL;
+ }
K = kmem_zalloc(sizeof(klua_State), KM_SLEEP);
K->L = lua_newstate(f, ud);
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/ufs/chfs/chfs_scan.c
--- a/sys/ufs/chfs/chfs_scan.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/ufs/chfs/chfs_scan.c Mon Feb 16 21:25:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chfs_scan.c,v 1.4.12.1 2014/09/08 18:57:58 msaitoh Exp $ */
+/* $NetBSD: chfs_scan.c,v 1.4.12.2 2015/02/16 21:25:34 martin Exp $ */
/*-
* Copyright (c) 2010 Department of Software Engineering,
@@ -461,6 +461,7 @@
read_free += CHFS_NODE_HDR_SIZE;
if (read_free >= MAX_READ_FREE(chmp)) {
dbg("rest of the block is free. Size: %d\n", cheb->free_size);
+ kmem_free(buf, CHFS_MAX_NODE_SIZE);
return chfs_scan_classify_cheb(chmp, cheb);
}
ofs += CHFS_NODE_HDR_SIZE;
diff -r 4c6b30bfb8a5 -r 103462fea50a sys/ufs/chfs/ebh.c
--- a/sys/ufs/chfs/ebh.c Mon Feb 16 20:48:40 2015 +0000
+++ b/sys/ufs/chfs/ebh.c Mon Feb 16 21:25:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ebh.c,v 1.3.14.1 2014/09/08 18:57:58 msaitoh Exp $ */
+/* $NetBSD: ebh.c,v 1.3.14.2 2015/02/16 21:25:34 martin Exp $ */
/*-
* Copyright (c) 2010 Department of Software Engineering,
@@ -1956,8 +1956,10 @@
ebhdr = kmem_alloc(sizeof(struct chfs_eb_hdr), KM_SLEEP);
err = leb_write_lock(ebh, lnr);
- if (err)
+ if (err) {
+ kmem_free(ebhdr, sizeof(struct chfs_eb_hdr));
return err;
+ }
retry:
pebnr = get_peb(ebh);
Home |
Main Index |
Thread Index |
Old Index