Skip to contentSkip to conversation

dma-buf: Fix ifnullfree.cocci warnings

PATCH In review Vasyl Gomonovych 2 participants 2 messages Nov 22, 2017 – Nov 23, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-buf: Fix ifnullfree.cocci warnings

NULL check before some freeing functions is not needed. drivers/dma-buf/dma-buf.c:1183:2-26: WARNING: NULL check before freeing debugfs_remove_recursive Generated by: scripts/coccinelle/free/ifnullfree.cocci

---
 drivers/dma-buf/dma-buf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma-buf/dma-buf.c +1 -2
index 4a038dcf5361..048827b06c03 100644
@@ -1179,8 +1179,7 @@ static int dma_buf_init_debugfs(void)
 
 static void dma_buf_uninit_debugfs(void)
 {
-	if (dma_buf_debugfs_dir)
-		debugfs_remove_recursive(dma_buf_debugfs_dir);
+	debugfs_remove_recursive(dma_buf_debugfs_dir);
 }
 #else
 static inline int dma_buf_init_debugfs(void)
Signature · 1 line
1.9.1
maintainer
#1 lore raw

Hello Vasyl,

Quoted 3 lines · Vasyl Gomonovych

NULL check before some freeing functions is not needed. drivers/dma-buf/dma-buf.c:1183:2-26: WARNING: NULL check before freeing debugfs_remove_recursive Generated by: scripts/coccinelle/free/ifnullfree.cocci

Thank you for your patch; applied to drm-misc-next.

Quoted 23 lines
---
 drivers/dma-buf/dma-buf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma-buf/dma-buf.c +1 -3
index 4a038dcf5361..048827b06c03 100644
@@ -1179,8 +1179,7 @@ static int dma_buf_init_debugfs(void)
 
 static void dma_buf_uninit_debugfs(void)
 {
-       if (dma_buf_debugfs_dir)
-               debugfs_remove_recursive(dma_buf_debugfs_dir);
+       debugfs_remove_recursive(dma_buf_debugfs_dir);
 }
 #else
 static inline int dma_buf_init_debugfs(void)
--

1.9.1

Signature · 9 lines
Thanks and regards,

Sumit Semwal
Linaro Mobile Group - Kernel Team Lead
Linaro.org │ Open source software for ARM SoCs
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel