From: Keith Busch Date: Wed, 10 Dec 2025 10:43:46 +0000 (-0800) Subject: blk-mq-dma: always initialize dma state X-Git-Tag: v6.19-rc1~23^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a0750fae73c55112ea11a4867bee40f11e679405;p=thirdparty%2Flinux.git blk-mq-dma: always initialize dma state Ensure the dma state is initialized when we're not using the contiguous iova, otherwise the caller may be using a stale state from a previous request that could use the coalesed iova allocation. Fixes: 2f6b2565d43cdb5 ("block: accumulate memory segment gaps per bio") Reported-by: Sebastian Ott Tested-by: Sebastian Ott Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c index e9108ccaf4b0..6dc7a3c23ac8 100644 --- a/block/blk-mq-dma.c +++ b/block/blk-mq-dma.c @@ -199,6 +199,7 @@ static bool blk_dma_map_iter_start(struct request *req, struct device *dma_dev, if (blk_can_dma_map_iova(req, dma_dev) && dma_iova_try_alloc(dma_dev, state, vec.paddr, total_len)) return blk_rq_dma_map_iova(req, dma_dev, state, iter, &vec); + memset(state, 0, sizeof(*state)); return blk_dma_map_direct(req, dma_dev, iter, &vec); }