diff mbox series

ARM: dmabounce: NULL check before some freeing functions is

Message ID 1551234375-6223-1-git-send-email-wdjjwb@163.com (mailing list archive)
State New, archived
Headers show
Series ARM: dmabounce: NULL check before some freeing functions is | expand

Commit Message

WangBo Feb. 27, 2019, 2:26 a.m. UTC
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 mbox series

Patch

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)