From aa6ddb64423f010039b4f9952c0aabb63612a1b5 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sun, 14 Aug 2016 10:32:17 +0000 Subject: [PATCH] Allow a bus_dmamap_sync() of length zero. ok tedu@ --- sys/arch/arm/arm/bus_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.20.1