From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbdKVPRg (ORCPT ); Wed, 22 Nov 2017 10:17:36 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34111 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbdKVPRe (ORCPT ); Wed, 22 Nov 2017 10:17:34 -0500 X-Google-Smtp-Source: AGs4zMYs3rSanfy+FEWBRYr9K+Sh1aqvXxpKCU3WcNcupYD6nJEKP9rn0W7+DPpNxsZ3GtMJbMxWlQ== From: Vasyl Gomonovych To: linux@armlinux.org.uk, alexander.h.duyck@intel.com, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] ARM: dma-mapping:Fix ifnullfree.cocci warnings Date: Wed, 22 Nov 2017 16:17:23 +0100 Message-Id: <1511363843-26202-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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