Commit 227a76b6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Konrad Rzeszutek Wilk
Browse files

swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit



Otherwise is_swiotlb_buffer will return false positives when
we first initialize a swiotlb buffer, but then free it because
we have an IOMMU available.

Fixes: 55897af6 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code")
Reported-by: default avatarSibren Vasse <sibren@sibrenvasse.nl>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarSibren Vasse <sibren@sibrenvasse.nl>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 1c7fc5cb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -378,6 +378,8 @@ void __init swiotlb_exit(void)
		memblock_free_late(io_tlb_start,
				   PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
	}
	io_tlb_start = 0;
	io_tlb_end = 0;
	io_tlb_nslabs = 0;
	max_segment = 0;
}