diff options
| author | christos <christos@NetBSD.org> | 2015-02-07 04:27:54 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2015-02-07 04:27:54 +0000 |
| commit | 914d14b36e3d1824efa9ef9408db96bae71e1cbe (patch) | |
| tree | 9cdde99ca0ac890e513dc757c5960388db04004e /sys/dev/ic | |
| parent | c94b48536a067285e56974829d1eeb4ca4a7b447 (diff) | |
don't leak pdata. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4
Diffstat (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/aic7xxx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c index 5005f8af8b4..8f7c6460d46 100644 --- a/sys/dev/ic/aic7xxx.c +++ b/sys/dev/ic/aic7xxx.c @@ -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; |
