summaryrefslogtreecommitdiffstats
path: root/sys/dev/fxp/if_fxp.c
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2009-01-08 04:26:44 +0000
committeryongari <yongari@FreeBSD.org>2009-01-08 04:26:44 +0000
commit8adb645b16ddc506b4b9e5ce06c08af2a1b524ed (patch)
treeaa73d572cc8eac894afb33588879702cca8e48fe /sys/dev/fxp/if_fxp.c
parentaf98809235f360c69043040e8e24f7b21ceb39ee (diff)
downloadFreeBSD-src-8adb645b16ddc506b4b9e5ce06c08af2a1b524ed.zip
FreeBSD-src-8adb645b16ddc506b4b9e5ce06c08af2a1b524ed.tar.gz
Always check whether dma map is valid before unloading the map.
When fxp(4) intializes Rx buffers for the first time, there is no loaded dma map so attempting to unload it is an invalid operation.
Diffstat (limited to 'sys/dev/fxp/if_fxp.c')
-rw-r--r--sys/dev/fxp/if_fxp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 9a6851c..ca1a614 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -2545,7 +2545,8 @@ fxp_new_rfabuf(struct fxp_softc *sc, struct fxp_rx *rxp)
return (error);
}
- bus_dmamap_unload(sc->fxp_mtag, rxp->rx_map);
+ if (rxp->rx_mbuf != NULL)
+ bus_dmamap_unload(sc->fxp_mtag, rxp->rx_map);
tmp_map = sc->spare_map;
sc->spare_map = rxp->rx_map;
rxp->rx_map = tmp_map;
OpenPOWER on IntegriCloud