Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/imx Fix memory leak (Brainy)
details: https://anonhg.NetBSD.org/src/rev/b02829d8dc16
branches: trunk
changeset: 337790:b02829d8dc16
user: christos <christos%NetBSD.org@localhost>
date: Mon Apr 27 17:34:51 2015 +0000
description:
Fix memory leak (Brainy)
diffstat:
sys/arch/arm/imx/if_enet.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r a3d0b0b88b6f -r b02829d8dc16 sys/arch/arm/imx/if_enet.c
--- a/sys/arch/arm/imx/if_enet.c Mon Apr 27 17:05:58 2015 +0000
+++ b/sys/arch/arm/imx/if_enet.c Mon Apr 27 17:34:51 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_enet.c,v 1.3 2015/04/13 21:18:41 riastradh Exp $ */
+/* $NetBSD: if_enet.c,v 1.4 2015/04/27 17:34:51 christos Exp $ */
/*
* Copyright (c) 2014 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.3 2015/04/13 21:18:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.4 2015/04/27 17:34:51 christos Exp $");
#include "imxocotp.h"
#include "imxccm.h"
@@ -1413,8 +1413,10 @@
error = bus_dmamap_load(sc->sc_dmat, sc->sc_rxsoft[idx].rxs_dmamap,
m->m_ext.ext_buf, m->m_ext.ext_size, NULL,
BUS_DMA_READ | BUS_DMA_NOWAIT);
- if (error)
+ if (error) {
+ m_freem(m);
return error;
+ }
bus_dmamap_sync(sc->sc_dmat, sc->sc_rxsoft[idx].rxs_dmamap, 0,
sc->sc_rxsoft[idx].rxs_dmamap->dm_mapsize,
Home |
Main Index |
Thread Index |
Old Index