Module Name:    src
Committed By:   christos
Date:           Sat Feb  7 04:27:54 UTC 2015

Modified Files:
        src/sys/dev/ic: aic7xxx.c

Log Message:
don't leak pdata. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/dev/ic/aic7xxx.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/aic7xxx.c
diff -u src/sys/dev/ic/aic7xxx.c:1.131 src/sys/dev/ic/aic7xxx.c:1.132
--- src/sys/dev/ic/aic7xxx.c:1.131	Thu Mar 27 14:28:26 2014
+++ src/sys/dev/ic/aic7xxx.c	Fri Feb  6 23:27:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx.c,v 1.131 2014/03/27 18:28:26 christos Exp $	*/
+/*	$NetBSD: aic7xxx.c,v 1.132 2015/02/07 04:27:54 christos 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.132 2015/02/07 04:27:54 christos 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.132 2015/02/07 04:27:54 christos Exp $");
 
 #include <dev/ic/aic7xxx_osm.h>
 #include <dev/ic/aic7xxx_inline.h>
@@ -4372,8 +4372,10 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
 			  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;

Reply via email to