Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci fix crash by NULL pointer dereferencing I get ev...
details: https://anonhg.NetBSD.org/src/rev/afa224384b68
branches: trunk
changeset: 765709:afa224384b68
user: cegger <cegger%NetBSD.org@localhost>
date: Fri Jun 03 09:51:40 2011 +0000
description:
fix crash by NULL pointer dereferencing I get everytime
right after this message:
bge0: discarding oversize frame (len=-4)
diffstat:
sys/dev/pci/if_bge.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r 64e7faa0e1bb -r afa224384b68 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c Fri Jun 03 09:15:02 2011 +0000
+++ b/sys/dev/pci/if_bge.c Fri Jun 03 09:51:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bge.c,v 1.196 2011/05/22 08:15:20 mrg Exp $ */
+/* $NetBSD: if_bge.c,v 1.197 2011/06/03 09:51:40 cegger Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.196 2011/05/22 08:15:20 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.197 2011/06/03 09:51:40 cegger Exp $");
#include "vlan.h"
#include "rnd.h"
@@ -3406,6 +3406,11 @@
stdcnt++;
dmamap = sc->bge_cdata.bge_rx_std_map[rxidx];
sc->bge_cdata.bge_rx_std_map[rxidx] = 0;
+ if (dmamap == NULL) {
+ ifp->if_ierrors++;
+ bge_newbuf_std(sc, sc->bge_std, m, dmamap);
+ continue;
+ }
bus_dmamap_sync(sc->bge_dmatag, dmamap, 0,
dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);
bus_dmamap_unload(sc->bge_dmatag, dmamap);
Home |
Main Index |
Thread Index |
Old Index