mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
swiotlb: bail out of swiotlb_init_late() if swiotlb is already allocated
If swiotlb is allocated, immediately return 0, so callers do not have to check io_tlb_default_mem.nslabs explicitly. Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
3fa6456ebe
commit
0c6874a6ac
@@ -384,6 +384,9 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
|
||||
bool retried = false;
|
||||
int rc = 0;
|
||||
|
||||
if (io_tlb_default_mem.nslabs)
|
||||
return 0;
|
||||
|
||||
if (swiotlb_force_disable)
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user