summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-03-23 21:34:21 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-03-23 21:34:21 +0000
commitf6f294d38e6fbe956474e30fe6f1b60a2d832ae5 (patch)
tree75d0f750fc39e003e056025e41a5b2a0f8c9a2f1
parentc83304ae1a2a7be720666d02d1494674131267af (diff)
Prevent null pointer dereference that could happen when we process an RX
interrupt that was queued while stopping the interface.
-rw-r--r--sys/dev/pci/if_msk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c
index 5ae87ca0740..add02a57b64 100644
--- a/sys/dev/pci/if_msk.c
+++ b/sys/dev/pci/if_msk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_msk.c,v 1.70 2009/03/16 12:47:35 deraadt Exp $ */
+/* $OpenBSD: if_msk.c,v 1.71 2009/03/23 21:34:20 kettenis Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1672,8 +1672,10 @@ msk_rxeof(struct sk_if_softc *sc_if, u_int16_t len, u_int32_t rxstat)
MSK_CDRXSYNC(sc_if, cur, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
cur_rx = &sc_if->sk_cdata.sk_rx_chain[cur];
- dmamap = sc_if->sk_cdata.sk_rx_jumbo_map;
+ if (cur_rx->sk_mbuf == NULL)
+ return;
+ dmamap = sc_if->sk_cdata.sk_rx_jumbo_map;
bus_dmamap_sync(sc_if->sk_softc->sc_dmatag, dmamap, 0,
dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);