summaryrefslogtreecommitdiffstats
path: root/sys/dev/bce
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-07-19 23:25:19 +0000
committeryongari <yongari@FreeBSD.org>2010-07-19 23:25:19 +0000
commit8c83d23ff01634af89e336ad2bf4e84ec778b1cc (patch)
treed452eba4dafc69805082281e44e71542bd66adcd /sys/dev/bce
parent4dc0d673ed0e553f2fbb6cbe52a86e5d4d134394 (diff)
downloadFreeBSD-src-8c83d23ff01634af89e336ad2bf4e84ec778b1cc.zip
FreeBSD-src-8c83d23ff01634af89e336ad2bf4e84ec778b1cc.tar.gz
Add KASSERT to check number of returned DMA segments.
Reviewed by: davidch
Diffstat (limited to 'sys/dev/bce')
-rw-r--r--sys/dev/bce/if_bce.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c
index c3477f8..3bd2470 100644
--- a/sys/dev/bce/if_bce.c
+++ b/sys/dev/bce/if_bce.c
@@ -3088,6 +3088,8 @@ bce_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error)
{
bus_addr_t *busaddr = arg;
+ KASSERT(nseg == 1, ("%s(): Too many segments returned (%d)!",
+ __FUNCTION__, nseg));
/* Simulate a mapping failure. */
DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control),
error = ENOMEM);
OpenPOWER on IntegriCloud