Add KASSERT to check number of returned DMA segments.

Reviewed by:	davidch
This commit is contained in:
Pyun YongHyeon 2010-07-19 23:25:19 +00:00
parent 62c3a412df
commit b18d9d4b15

View File

@ -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);