Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/arch Pull up following revision(s) (requested by maxv...
details: https://anonhg.NetBSD.org/src/rev/458fcc1d62a2
branches: netbsd-7
changeset: 798527:458fcc1d62a2
user: snj <snj%NetBSD.org@localhost>
date: Mon Nov 10 17:59:56 2014 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #195):
sys/arch/arm/iomd/iomd_irqhandler.c: revision 1.21
sys/arch/arm/ofw/ofw_irqhandler.c: revision 1.21
sys/arch/atari/atari/intr.c: revision 1.24-1.25
sys/arch/ews4800mips/sbd/fb_sbdio.c: revision 1.14
sys/arch/hpcmips/tx/tx39icu.c: revision 1.34
sys/arch/shark/isa/isa_irqhandler.c: revision 1.27
sys/arch/sparc/sparc/machdep.c: revision 1.327
sys/arch/sparc64/dev/psycho.c: revision 1.119
sys/arch/sparc64/dev/schizo.c: revision 1.32
sys/arch/sparc64/sparc64/machdep.c: revision 1.279
sys/arch/sun68k/sun68k/bus.c: revision 1.22
sys/arch/x86/x86/ipmi.c: revision 1.58
sys/arch/xen/xen/privcmd.c: revision 1.46-1.49
Fix several memory leaks.
diffstat:
sys/arch/arm/iomd/iomd_irqhandler.c | 8 +++++---
sys/arch/arm/ofw/ofw_irqhandler.c | 8 +++++---
sys/arch/atari/atari/intr.c | 14 +++++++++-----
sys/arch/ews4800mips/sbd/fb_sbdio.c | 5 +++--
sys/arch/hpcmips/tx/tx39icu.c | 16 +++++++---------
sys/arch/shark/isa/isa_irqhandler.c | 8 +++++---
sys/arch/sparc/sparc/machdep.c | 8 +++++---
sys/arch/sparc64/dev/psycho.c | 8 ++++----
sys/arch/sparc64/dev/schizo.c | 5 +++--
sys/arch/sparc64/sparc64/machdep.c | 8 +++++---
sys/arch/sun68k/sun68k/bus.c | 8 +++++---
sys/arch/x86/x86/ipmi.c | 5 +++--
sys/arch/xen/xen/privcmd.c | 9 ++++++---
13 files changed, 65 insertions(+), 45 deletions(-)
diffs (truncated from 427 to 300 lines):
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/arm/iomd/iomd_irqhandler.c
--- a/sys/arch/arm/iomd/iomd_irqhandler.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/arm/iomd/iomd_irqhandler.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iomd_irqhandler.c,v 1.20 2014/03/26 19:44:51 christos Exp $ */
+/* $NetBSD: iomd_irqhandler.c,v 1.20.4.1 2014/11/10 17:59:56 snj Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.20 2014/03/26 19:44:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.20.4.1 2014/11/10 17:59:56 snj Exp $");
#include "opt_irqstats.h"
@@ -356,8 +356,10 @@
ih->ih_arg = ih_arg;
ih->ih_flags = 0;
- if (irq_claim(irq, ih) != 0)
+ if (irq_claim(irq, ih) != 0) {
+ free(ih, M_DEVBUF);
return NULL;
+ }
return ih;
}
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/arm/ofw/ofw_irqhandler.c
--- a/sys/arch/arm/ofw/ofw_irqhandler.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/arm/ofw/ofw_irqhandler.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_irqhandler.c,v 1.20 2014/06/20 13:17:59 joerg Exp $ */
+/* $NetBSD: ofw_irqhandler.c,v 1.20.2.1 2014/11/10 17:59:56 snj Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_irqhandler.c,v 1.20 2014/06/20 13:17:59 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_irqhandler.c,v 1.20.2.1 2014/11/10 17:59:56 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -301,8 +301,10 @@
ih->ih_arg = ih_arg;
ih->ih_flags = 0;
- if (irq_claim(irq, ih, group, name) != 0)
+ if (irq_claim(irq, ih, group, name) != 0) {
+ free(ih, M_DEVBUF);
return(NULL);
+ }
return(ih);
}
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/atari/atari/intr.c
--- a/sys/arch/atari/atari/intr.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/atari/atari/intr.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.23 2010/12/20 00:25:30 matt Exp $ */
+/* $NetBSD: intr.c,v 1.23.34.1 2014/11/10 17:59:56 snj Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.23 2010/12/20 00:25:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.23.34.1 2014/11/10 17:59:56 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -132,21 +132,25 @@
*/
switch (type & (AUTO_VEC|USER_VEC)) {
case AUTO_VEC:
- if (vector < AVEC_MIN || vector > AVEC_MAX)
+ if (vector < AVEC_MIN || vector > AVEC_MAX) {
+ free(ih, M_DEVBUF);
return NULL;
+ }
vec_list = &autovec_list[vector-1];
hard_vec = &autovects[vector-1];
ih->ih_intrcnt = &intrcnt_auto[vector-1];
break;
case USER_VEC:
- if (vector < UVEC_MIN || vector > UVEC_MAX)
+ if (vector < UVEC_MIN || vector > UVEC_MAX) {
+ free(ih, M_DEVBUF);
return NULL;
+ }
vec_list = &uservec_list[vector];
hard_vec = &uservects[vector];
ih->ih_intrcnt = &intrcnt_user[vector];
break;
default:
- printf("intr_establish: bogus vector type\n");
+ printf("%s: bogus vector type\n", __func__);
free(ih, M_DEVBUF);
return NULL;
}
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/ews4800mips/sbd/fb_sbdio.c
--- a/sys/arch/ews4800mips/sbd/fb_sbdio.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/ews4800mips/sbd/fb_sbdio.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fb_sbdio.c,v 1.13 2014/01/31 15:41:48 tsutsui Exp $ */
+/* $NetBSD: fb_sbdio.c,v 1.13.4.1 2014/11/10 17:59:56 snj Exp $ */
/*-
* Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#define WIRED_FB_TLB
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fb_sbdio.c,v 1.13 2014/01/31 15:41:48 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fb_sbdio.c,v 1.13.4.1 2014/11/10 17:59:56 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -154,6 +154,7 @@
ga = malloc(sizeof(struct ga), M_DEVBUF, M_NOWAIT | M_ZERO);
if (ga == NULL) {
printf(":can't allocate ga memory\n");
+ free(ri, M_DEVBUF);
return;
}
ga->reg_paddr = sa->sa_addr2;
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/hpcmips/tx/tx39icu.c
--- a/sys/arch/hpcmips/tx/tx39icu.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/hpcmips/tx/tx39icu.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tx39icu.c,v 1.33 2014/03/26 17:53:36 christos Exp $ */
+/* $NetBSD: tx39icu.c,v 1.33.4.1 2014/11/10 17:59:56 snj Exp $ */
/*-
* Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tx39icu.c,v 1.33 2014/03/26 17:53:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tx39icu.c,v 1.33.4.1 2014/11/10 17:59:56 snj Exp $");
#include "opt_vr41xx.h"
#include "opt_tx39xx.h"
@@ -634,11 +634,9 @@
s = splhigh();
sc = tc->tc_intrt;
- if (!(p = malloc(sizeof(struct txpoll_entry),
- M_DEVBUF, M_NOWAIT))) {
+ if (!(p = malloc(sizeof(*p), M_DEVBUF, M_NOWAIT | M_ZERO))) {
panic ("tx39_poll_establish: no memory.");
}
- memset(p, 0, sizeof(struct txpoll_entry));
p->p_fun = ih_fun;
p->p_arg = ih_arg;
@@ -647,13 +645,13 @@
if (!sc->sc_polling) {
tx39clock_alarm_set(tc, 33); /* 33 msec */
- if (!(sc->sc_poll_ih =
- tx_intr_establish(
- tc, MAKEINTR(5, TX39_INTRSTATUS5_ALARMINT),
- IST_EDGE, level, tx39_poll_intr, sc))) {
+ if (!(sc->sc_poll_ih = tx_intr_establish(
+ tc, MAKEINTR(5, TX39_INTRSTATUS5_ALARMINT),
+ IST_EDGE, level, tx39_poll_intr, sc))) {
printf("tx39_poll_establish: can't hook\n");
splx(s);
+ free(p, M_DEVBUF);
return (0);
}
}
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/shark/isa/isa_irqhandler.c
--- a/sys/arch/shark/isa/isa_irqhandler.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/shark/isa/isa_irqhandler.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_irqhandler.c,v 1.26 2014/02/22 18:56:25 matt Exp $ */
+/* $NetBSD: isa_irqhandler.c,v 1.26.4.1 2014/11/10 17:59:56 snj Exp $ */
/*
* Copyright 1997
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_irqhandler.c,v 1.26 2014/02/22 18:56:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_irqhandler.c,v 1.26.4.1 2014/11/10 17:59:56 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -320,8 +320,10 @@
ih->ih_arg = ih_arg;
ih->ih_flags = 0;
- if (irq_claim(irq, ih, group, name) != 0)
+ if (irq_claim(irq, ih, group, name) != 0) {
+ free(ih, M_DEVBUF);
return(NULL);
+ }
return(ih);
}
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/sparc/sparc/machdep.c
--- a/sys/arch/sparc/sparc/machdep.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/sparc/sparc/machdep.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.326 2014/02/28 10:16:51 skrll Exp $ */
+/* $NetBSD: machdep.c,v 1.326.4.1 2014/11/10 17:59:57 snj Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.326 2014/02/28 10:16:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.326.4.1 2014/11/10 17:59:57 snj Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_sunos.h"
@@ -1378,8 +1378,10 @@
*/
error = uvm_pglistalloc(size, low, high, 0, 0,
mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
- if (error)
+ if (error) {
+ free(mlist, M_DEVBUF);
return (error);
+ }
/*
* Simply keep a pointer around to the linked list, so
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/sparc64/dev/psycho.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psycho.c,v 1.118 2013/12/07 11:17:24 nakayama Exp $ */
+/* $NetBSD: psycho.c,v 1.118.4.1 2014/11/10 17:59:57 snj Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.118 2013/12/07 11:17:24 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.118.4.1 2014/11/10 17:59:57 snj Exp $");
#include "opt_ddb.h"
@@ -1272,8 +1272,7 @@
int ino;
long vec = INTVEC(ihandle);
- ih = (struct intrhand *)
- malloc(sizeof(struct intrhand), M_DEVBUF, M_NOWAIT);
+ ih = malloc(sizeof(struct intrhand), M_DEVBUF, M_NOWAIT);
if (ih == NULL)
return (NULL);
@@ -1342,6 +1341,7 @@
}
printf("Cannot find interrupt vector %lx\n", vec);
+ free(ih, M_DEVBUF);
return (NULL);
found:
diff -r 0e534bf1f93d -r 458fcc1d62a2 sys/arch/sparc64/dev/schizo.c
--- a/sys/arch/sparc64/dev/schizo.c Mon Nov 10 16:32:56 2014 +0000
+++ b/sys/arch/sparc64/dev/schizo.c Mon Nov 10 17:59:56 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: schizo.c,v 1.31 2013/06/21 20:09:58 nakayama Exp $ */
+/* $NetBSD: schizo.c,v 1.31.8.1 2014/11/10 17:59:57 snj Exp $ */
/* $OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $ */
/*
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: schizo.c,v 1.31 2013/06/21 20:09:58 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: schizo.c,v 1.31.8.1 2014/11/10 17:59:57 snj Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -195,6 +195,7 @@
ma->ma_reg[0].ur_len,
BUS_SPACE_MAP_LINEAR, &pbm->sp_intrh)) {
aprint_error(": failed to interrupt map registers\n");
Home |
Main Index |
Thread Index |
Old Index