From patchwork Thu Jan 12 13:38:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9513203 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6146560476 for ; Thu, 12 Jan 2017 13:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 532C828632 for ; Thu, 12 Jan 2017 13:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47ECE286B2; Thu, 12 Jan 2017 13:39:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DAE828632 for ; Thu, 12 Jan 2017 13:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750796AbdALNji (ORCPT ); Thu, 12 Jan 2017 08:39:38 -0500 Received: from mga11.intel.com ([192.55.52.93]:28201 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbdALNjh (ORCPT ); Thu, 12 Jan 2017 08:39:37 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 12 Jan 2017 05:39:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,349,1477983600"; d="scan'208";a="212549443" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga004.fm.intel.com with ESMTP; 12 Jan 2017 05:39:09 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1cRfd4-000Tja-3z; Thu, 12 Jan 2017 21:41:22 +0800 Date: Thu, 12 Jan 2017 21:38:58 +0800 From: kbuild test robot To: George Cherian Cc: kbuild-all@01.org, herbert@gondor.apana.org.au, davem@davemloft.net, david.daney@cavium.com, clabbe.montjoie@gmail.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, George Cherian Subject: [PATCH] drivers: crypto: fix ifnullfree.cocci warnings Message-ID: <20170112133857.GA56852@cairo.lkp.intel.com> References: <201701122154.qOAETU7M%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1484132211-917-4-git-send-email-george.cherian@cavium.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/crypto/cavium/cpt/cptvf_reqmanager.c:312:2-8: 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. drivers/crypto/cavium/cpt/cptvf_reqmanager.c:315:2-8: 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. drivers/crypto/cavium/cpt/cptvf_reqmanager.c:318:2-8: 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. drivers/crypto/cavium/cpt/cptvf_reqmanager.c:321:2-8: 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 CC: George Cherian Signed-off-by: Fengguang Wu --- cptvf_reqmanager.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/crypto/cavium/cpt/cptvf_reqmanager.c +++ b/drivers/crypto/cavium/cpt/cptvf_reqmanager.c @@ -308,17 +308,13 @@ void do_request_cleanup(struct cpt_vf *c } } - if (info->scatter_components) - kzfree(info->scatter_components); + kzfree(info->scatter_components); - if (info->gather_components) - kzfree(info->gather_components); + kzfree(info->gather_components); - if (info->out_buffer) - kzfree(info->out_buffer); + kzfree(info->out_buffer); - if (info->in_buffer) - kzfree(info->in_buffer); + kzfree(info->in_buffer); if (info->completion_addr) kzfree((void *)info->completion_addr);