From 3bebdc0564eb597ca11de52fff89308fb4a7edce Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Wed, 2 Sep 2020 11:33:31 +0000 Subject: [PATCH] riscv: very large dma mappings can cause integer overflow Fix the return type for _bus_dmamap_addseg(). Based on the same fix done for arm64 in r348571. Sponsored by: Axiado --- sys/riscv/riscv/busdma_bounce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/riscv/riscv/busdma_bounce.c b/sys/riscv/riscv/busdma_bounce.c index 75d64a4ec8d..8ca803f13cd 100644 --- a/sys/riscv/riscv/busdma_bounce.c +++ b/sys/riscv/riscv/busdma_bounce.c @@ -633,7 +633,7 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) /* * Add a single contiguous physical range to the segment list. */ -static int +static bus_size_t _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) { -- 2.45.0