Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic don't leak pdata. Reported by:



details:   https://anonhg.NetBSD.org/src/rev/1684f5939747
branches:  trunk
changeset: 806166:1684f5939747
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 07 04:27:54 2015 +0000

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

diffstat:

 sys/dev/ic/aic7xxx.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 3d308030b6fd -r 1684f5939747 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Sat Feb 07 04:25:16 2015 +0000
+++ b/sys/dev/ic/aic7xxx.c      Sat Feb 07 04:27:54 2015 +0000
@@ -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_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;



Home | Main Index | Thread Index | Old Index