Merge tag 'slab-fixes-for-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / mm / slab_common.c
index 306e6f0074ff6fabab00a713ee70968262d121c0..8fda308e400db80d031a702b58d7ae4980badc43 100644 (file)
@@ -895,10 +895,9 @@ void __init setup_kmalloc_cache_index_table(void)
 
 static unsigned int __kmalloc_minalign(void)
 {
-#ifdef CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC
-       if (io_tlb_default_mem.nslabs)
+       if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) &&
+           is_swiotlb_allocated())
                return ARCH_KMALLOC_MINALIGN;
-#endif
        return dma_get_cache_alignment();
 }