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

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
...@@ -378,6 +378,8 @@ void __init swiotlb_exit(void) ...@@ -378,6 +378,8 @@ void __init swiotlb_exit(void)
memblock_free_late(io_tlb_start, memblock_free_late(io_tlb_start,
PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT)); PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
} }
io_tlb_start = 0;
io_tlb_end = 0;
io_tlb_nslabs = 0; io_tlb_nslabs = 0;
max_segment = 0; max_segment = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment