From: kettenis Date: Sun, 14 Aug 2016 10:32:17 +0000 (+0000) Subject: Allow a bus_dmamap_sync() of length zero. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=aa6ddb64423f010039b4f9952c0aabb63612a1b5;p=openbsd Allow a bus_dmamap_sync() of length zero. ok tedu@ --- diff --git a/sys/arch/arm/arm/bus_dma.c b/sys/arch/arm/arm/bus_dma.c index cdd7c21282b..6f696146a71 100644 --- a/sys/arch/arm/arm/bus_dma.c +++ b/sys/arch/arm/arm/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.30 2016/05/16 15:13:50 kettenis Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.31 2016/08/14 10:32:17 kettenis Exp $ */ /* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */ /*- @@ -589,7 +589,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t offset, if (offset >= map->dm_mapsize) panic("_bus_dmamap_sync: bad offset %lu (map size is %lu)", offset, map->dm_mapsize); - if (len == 0 || (offset + len) > map->dm_mapsize) + if ((offset + len) > map->dm_mapsize) panic("_bus_dmamap_sync: bad length"); #endif