fix leak.

This commit is contained in:
christos 2014-09-21 15:46:44 +00:00
parent 80d9ffa917
commit 32d612a206
2 changed files with 10 additions and 6 deletions

View File

@ -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.21 2014/09/21 15:46:44 christos 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.21 2014/09/21 15:46:44 christos Exp $");
#include "opt_irqstats.h"
@ -356,8 +356,10 @@ intr_claim(int irq, int level, const char *name, int (*ih_func)(void *),
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;
}

View File

@ -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.21 2014/09/21 15:47:29 christos 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.21 2014/09/21 15:47:29 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -301,8 +301,10 @@ intr_claim(int irq, int level, int (*ih_func)(void *), void *ih_arg, const char
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);
}