linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dmabounce: NULL check before some freeing functions is
@ 2019-02-27  2:26 WangBo
  0 siblings, 0 replies; only message in thread
From: WangBo @ 2019-02-27  2:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: rmk+kernel, linux-arm-kernel, wang.bo116

The function dma_pool_destroy(NULL) is safe, so removes NULL check before 
freeing the mem. This patch also fix the ifnullfree.cocci warnings.

Signed-off-by: WangBo <wang.bo116@zte.com.cn>
---
 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 5ba4622..dd520a3 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -563,10 +563,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)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-27  2:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27  2:26 [PATCH] ARM: dmabounce: NULL check before some freeing functions is WangBo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).