提交 227a76b6 编写于 作者: C Christoph Hellwig 提交者: 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: NSibren Vasse <sibren@sibrenvasse.nl>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Tested-by: NSibren Vasse <sibren@sibrenvasse.nl>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 1c7fc5cb
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册