fix leak
This commit is contained in:
parent
ce6e7b2537
commit
50369d2f23
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: psycho.c,v 1.118 2013/12/07 11:17:24 nakayama Exp $ */
|
||||
/* $NetBSD: psycho.c,v 1.119 2014/09/21 16:39:12 christos 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.119 2014/09/21 16:39:12 christos Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
@ -1272,8 +1272,7 @@ psycho_intr_establish(bus_space_tag_t t, int ihandle, int level,
|
||||
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 @@ psycho_intr_establish(bus_space_tag_t t, int ihandle, int level,
|
||||
}
|
||||
|
||||
printf("Cannot find interrupt vector %lx\n", vec);
|
||||
free(ih, M_DEVBUF);
|
||||
return (NULL);
|
||||
|
||||
found:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: schizo.c,v 1.31 2013/06/21 20:09:58 nakayama Exp $ */
|
||||
/* $NetBSD: schizo.c,v 1.32 2014/09/21 16:39:12 christos 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.32 2014/09/21 16:39:12 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
@ -195,6 +195,7 @@ schizo_attach(device_t parent, device_t self, void *aux)
|
||||
ma->ma_reg[0].ur_len,
|
||||
BUS_SPACE_MAP_LINEAR, &pbm->sp_intrh)) {
|
||||
aprint_error(": failed to interrupt map registers\n");
|
||||
kmem_free(pbm, sizeof(*pbm));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.278 2014/07/14 12:40:38 nakayama Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.279 2014/09/21 16:37:34 christos 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.278 2014/07/14 12:40:38 nakayama Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.279 2014/09/21 16:37:34 christos Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_multiprocessor.h"
|
||||
@ -1437,8 +1437,10 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
|
||||
*/
|
||||
error = uvm_pglistalloc(size, low, high,
|
||||
alignment, boundary, pglist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
|
||||
if (error)
|
||||
if (error) {
|
||||
free(pglist, M_DEVBUF);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the location, size, and number of segments actually
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bus.c,v 1.21 2008/06/04 12:41:41 ad Exp $ */
|
||||
/* $NetBSD: bus.c,v 1.22 2014/09/21 16:40:10 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
@ -153,7 +153,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.21 2008/06/04 12:41:41 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.22 2014/09/21 16:40:10 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -266,8 +266,10 @@ extern paddr_t avail_end;
|
||||
*/
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user