All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dma-mapping:Fix ifnullfree.cocci warnings
@ 2017-11-22 15:17 ` Vasyl Gomonovych
  0 siblings, 0 replies; 2+ messages in thread
From: Vasyl Gomonovych @ 2017-11-22 15:17 UTC (permalink / raw)
  To: linux, alexander.h.duyck, akpm, linux-arm-kernel; +Cc: linux-kernel, gomonovych

NULL check before some freeing functions is not needed.

arch/arm/common/dmabounce.c:573:2-18: WARNING: NULL check before freeing functions like kfree
arch/arm/common/dmabounce.c:575:2-18: WARNING: NULL check before freeing functions like kfree
Generated by: scripts/coccinelle/free/ifnullfree.cocci

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 arch/arm/common/dmabounce.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 9a92de63426f..dcdd80c7a543 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -569,10 +569,8 @@ void dmabounce_unregister_dev(struct device *dev)
 		BUG();
 	}
 
-	if (device_info->small.pool)
-		dma_pool_destroy(device_info->small.pool);
-	if (device_info->large.pool)
-		dma_pool_destroy(device_info->large.pool);
+	dma_pool_destroy(device_info->small.pool);
+	dma_pool_destroy(device_info->large.pool);
 
 #ifdef STATS
 	if (device_info->attr_res == 0)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] ARM: dma-mapping:Fix ifnullfree.cocci warnings
@ 2017-11-22 15:17 ` Vasyl Gomonovych
  0 siblings, 0 replies; 2+ messages in thread
From: Vasyl Gomonovych @ 2017-11-22 15:17 UTC (permalink / raw)
  To: linux-arm-kernel

NULL check before some freeing functions is not needed.

arch/arm/common/dmabounce.c:573:2-18: WARNING: NULL check before freeing functions like kfree
arch/arm/common/dmabounce.c:575:2-18: WARNING: NULL check before freeing functions like kfree
Generated by: scripts/coccinelle/free/ifnullfree.cocci

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 arch/arm/common/dmabounce.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 9a92de63426f..dcdd80c7a543 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -569,10 +569,8 @@ void dmabounce_unregister_dev(struct device *dev)
 		BUG();
 	}
 
-	if (device_info->small.pool)
-		dma_pool_destroy(device_info->small.pool);
-	if (device_info->large.pool)
-		dma_pool_destroy(device_info->large.pool);
+	dma_pool_destroy(device_info->small.pool);
+	dma_pool_destroy(device_info->large.pool);
 
 #ifdef STATS
 	if (device_info->attr_res == 0)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-22 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 15:17 [PATCH] ARM: dma-mapping:Fix ifnullfree.cocci warnings Vasyl Gomonovych
2017-11-22 15:17 ` Vasyl Gomonovych

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.