Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1287326img; Tue, 26 Feb 2019 18:28:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IbU38n2t2S4rdn8NbHM10Ca9XuVZcbxEbXPU7+alBibJ3bnaY3wPZePDvnCREM5PF8Hcyi6 X-Received: by 2002:a17:902:9304:: with SMTP id bc4mr30058657plb.81.1551234515287; Tue, 26 Feb 2019 18:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551234515; cv=none; d=google.com; s=arc-20160816; b=Ts3mDQsGdrS9UG3KGDQ8+bEPqC2fiFKxDTVNsFIRNZQTntFJYWAfUDz72a2gjVJhzE th1uiSnzNN4KKMDOdpjXGEaxH9EjNdaWrL6DsNQCcPX7rq0h+B517knluoPhHGnaqmVA mNJj0iEO5WXLrpAUdsCrbLxPXy9Gd7xlJLHXD7nUflSOCCT/MZ3goK2tUDT5bZhO2DMb NO4sHzCqi7gQZuM1o2lpvwrCiQ9i6/xjWnMT0bfpIVR3dUphmyMeYXsIdjy80j7hmc8j S3xY6ihm/VZj5bRw9PwRrBe6br1aKrfoSjdAA5BCfl1P/wS+7wrwW8K0T6VWwjbYw7qU nMFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=btUcs3+/xyWYxVRVE52HFznfCYpsm3BUMuXFtIGU9Qw=; b=QoydpM8nGEK7mPZqdqYgHTqizSMxv191On/4TNkDGn/SC/vRbwoMqBlsjMioCxR9Z6 lDIynXay/x7MnRCPnFkFn1Rjyf7x/f4pT8tCuc6Th4UT5wWXrl7HwtYGOm29r2eM2n47 XmDWmtB2x1nF2PAuvRCxUoi1UOaF9bIvtPAEIcNs+pPembpQsaISscre9g0wTnnNIIJk YGeH9wuqf/sE8eNR79Rs9J9D7N/j0K7iLMOZBL0pFeE1UwzGyyloYKnc/yY+NRuuVnS+ OTuqRTiSVr6zhOsvse97AUKiKd4eaiLoeR+irGz0KuDDMuaiMrSU2rQm3uZrCnEVjR/J HoKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=lUqUQLBZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185si13679260pge.2.2019.02.26.18.28.19; Tue, 26 Feb 2019 18:28:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=lUqUQLBZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729475AbfB0C0p (ORCPT + 99 others); Tue, 26 Feb 2019 21:26:45 -0500 Received: from m12-17.163.com ([220.181.12.17]:59617 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729243AbfB0C0p (ORCPT ); Tue, 26 Feb 2019 21:26:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=btUcs3+/xyWYxVRVE5 2HFznfCYpsm3BUMuXFtIGU9Qw=; b=lUqUQLBZznXZsTROYcOsm7SzLMS5p4lN5V cfJ9eb8QboGKMdsqnwSbvCDPLsOvILKr8mx1+faC5IUkKYQ+dNN4d3MYROGqk+yX 2qDsztZxbMwRxogVlSAcQlJHFq8VGyxip2RoGH/kD0Aqo91IKVSwvZYLjZRnA3/h b3Jw9GhXg= Received: from localhost.localdomain (unknown [182.151.187.141]) by smtp13 (Coremail) with SMTP id EcCowABnNtdJ9XVcr0WqHg--.29349S2; Wed, 27 Feb 2019 10:26:18 +0800 (CST) From: WangBo To: linux-kernel@vger.kernel.org Cc: rmk+kernel@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, wang.bo116@zte.com.cn Subject: [PATCH] ARM: dmabounce: NULL check before some freeing functions is Date: Wed, 27 Feb 2019 10:26:15 +0800 Message-Id: <1551234375-6223-1-git-send-email-wdjjwb@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: EcCowABnNtdJ9XVcr0WqHg--.29349S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrur15GF1fCryUCr1rCw4DJwb_yoWfAFg_Ar yxt3ykur95ZF4kWF4ayr1rur1fA3yrXFWFvF18Jrs7GanYqr9xArnrZ3yfK3W2gayjvr9x XrWUZryjyr12kjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnjsjUUUUUU== X-Originating-IP: [182.151.187.141] X-CM-SenderInfo: xzgmy4re6rljoofrz/xtbBEApoGVUMK+Nl1wAAsI Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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