From patchwork Sun Apr 23 09:26:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 97967 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1005457qgf; Sun, 23 Apr 2017 02:29:59 -0700 (PDT) X-Received: by 10.84.128.99 with SMTP id 90mr25662080pla.166.1492939799648; Sun, 23 Apr 2017 02:29:59 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x190si15388173pfb.70.2017.04.23.02.29.59; Sun, 23 Apr 2017 02:29:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1044566AbdDWJ35 (ORCPT + 7 others); Sun, 23 Apr 2017 05:29:57 -0400 Received: from foss.arm.com ([217.140.101.70]:47138 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1044463AbdDWJ2F (ORCPT ); Sun, 23 Apr 2017 05:28:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 832D219BF; Sun, 23 Apr 2017 02:27:37 -0700 (PDT) Received: from gby.kfn.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 65DD23F220; Sun, 23 Apr 2017 02:27:33 -0700 (PDT) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" , Rob Herring , Mark Rutland , Greg Kroah-Hartman , devel@driverdev.osuosl.org Cc: linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, gilad.benyossef@arm.com, Binoy Jayan , Ofir Drang , Stuart Yoder , Stephan Muller , kbuild test robot , Fengguang Wu Subject: [PATCH v3 14/15] staging: ccree: fix ifnullfree.cocci warnings Date: Sun, 23 Apr 2017 12:26:22 +0300 Message-Id: <1492939583-25688-15-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1492939583-25688-1-git-send-email-gilad@benyossef.com> References: <1492939583-25688-1-git-send-email-gilad@benyossef.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: kbuild test robot drivers/staging/ccree/ssi_buffer_mgr.c:530:3-19: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Signed-off-by: Gilad Ben-Yossef Signed-off-by: Fengguang Wu --- drivers/staging/ccree/ssi_buffer_mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index af50904..038e2ff 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -1863,8 +1863,7 @@ int ssi_buffer_mgr_fini(struct ssi_drvdata *drvdata) struct buff_mgr_handle *buff_mgr_handle = drvdata->buff_mgr_handle; if (buff_mgr_handle != NULL) { - if (buff_mgr_handle->mlli_buffs_pool != NULL) - dma_pool_destroy(buff_mgr_handle->mlli_buffs_pool); + dma_pool_destroy(buff_mgr_handle->mlli_buffs_pool); kfree(drvdata->buff_mgr_handle); drvdata->buff_mgr_handle = NULL;