lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210630040616.3914990-1-tientzu@chromium.org>
Date:   Wed, 30 Jun 2021 12:06:15 +0800
From:   Claire Chang <tientzu@...omium.org>
To:     konrad.wilk@...cle.com, hch@....de, m.szyprowski@...sung.com,
        robin.murphy@....com, Will Deacon <will@...nel.org>,
        sstabellini@...nel.org
Cc:     iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
        tfiga@...omium.org, Nicolas Boichat <drinkcat@...omium.org>,
        Claire Chang <tientzu@...omium.org>,
        kernel test robot <lkp@...el.com>
Subject: [PATCH v3] swiotlb: fix implicit debugfs_create_dir declaration

Factor out the debugfs bits from rmem_swiotlb_device_init() into a separate
rmem_swiotlb_debugfs_init().

Fixes: 461021875c50 ("swiotlb: Add restricted DMA pool initialization")
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Claire Chang <tientzu@...omium.org>
---
 kernel/dma/swiotlb.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 0ffbaae9fba2..355dc98d381c 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -709,6 +709,16 @@ static int __init swiotlb_create_default_debugfs(void)
 
 late_initcall(swiotlb_create_default_debugfs);
 
+static void rmem_swiotlb_debugfs_init(const char *name, struct io_tlb_mem *mem)
+{
+	mem->debugfs = debugfs_create_dir(name, debugfs_dir);
+	swiotlb_create_debugfs_files(mem);
+}
+#else
+__maybe_unused static void rmem_swiotlb_debugfs_init(const char *name,
+						     struct io_tlb_mem *mem)
+{
+}
 #endif
 
 #ifdef CONFIG_DMA_RESTRICTED_POOL
@@ -766,11 +776,8 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 
 		rmem->priv = mem;
 
-		if (IS_ENABLED(CONFIG_DEBUG_FS)) {
-			mem->debugfs =
-				debugfs_create_dir(rmem->name, debugfs_dir);
-			swiotlb_create_debugfs_files(mem);
-		}
+		if (IS_ENABLED(CONFIG_DEBUG_FS))
+			rmem_swiotlb_debugfs_init(rmem->name, mem);
 	}
 
 	dev->dma_io_tlb_mem = mem;
-- 
2.32.0.93.g670b81a890-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ