diff options
author | Petr Tesarik <petr.tesarik.ext@huawei.com> | 2023-08-01 08:23:56 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2023-08-01 18:02:02 +0200 |
commit | 0c6874a6ac0474b54c8d1ba33e243ec578ff815a (patch) | |
tree | d3de8f2e381871d8b58bf7b56ac0bdb24b23cff3 /kernel/dma | |
parent | 3fa6456ebe13adab3ba1817c8e515a5b88f95dce (diff) |
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>
Diffstat (limited to 'kernel/dma')
-rw-r--r-- | kernel/dma/swiotlb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 1c0a49e6685a..ee57fd9949dc 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -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; |