From patchwork Sat Mar 11 07:15:21 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: 9618449 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 B4B96604CC for ; Sat, 11 Mar 2017 07:16:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A76932874B for ; Sat, 11 Mar 2017 07:16:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C08D287AF; Sat, 11 Mar 2017 07:16:26 +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 DDDD52874B for ; Sat, 11 Mar 2017 07:16:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755639AbdCKHQD (ORCPT ); Sat, 11 Mar 2017 02:16:03 -0500 Received: from mga01.intel.com ([192.55.52.88]:16554 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755628AbdCKHPy (ORCPT ); Sat, 11 Mar 2017 02:15:54 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2017 23:15:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,145,1486454400"; d="scan'208";a="234830195" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga004.fm.intel.com with ESMTP; 10 Mar 2017 23:15:38 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1cmbHe-000JZy-3W; Sat, 11 Mar 2017 15:17:46 +0800 Date: Sat, 11 Mar 2017 15:15:21 +0800 From: kbuild test robot To: Romain Perier Cc: kbuild-all@01.org, Dan Williams , Doug Ledford , Sean Hefty , Hal Rosenstock , jeffrey.t.kirsher@intel.com, "David S. Miller" , stas.yakovlev@gmail.com, "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , Greg Kroah-Hartman , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Romain Perier , Peter Senna Tschudin Subject: [PATCH] block: DAC960: fix ifnullfree.cocci warnings Message-ID: <20170311071521.GA16525@lkp-wsm-ep1> References: <201703111417.0LzAlMy8%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170308161957.28941-2-romain.perier@collabora.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-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/block/DAC960.c:441: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. drivers/block/DAC960.c:446:1-17: 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: Romain Perier Signed-off-by: Fengguang Wu --- DAC960.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -437,13 +437,11 @@ static void DAC960_DestroyAuxiliaryStruc Controller->CurrentStatusBuffer = NULL; } - if (ScatterGatherPool != NULL) - dma_pool_destroy(ScatterGatherPool); + dma_pool_destroy(ScatterGatherPool); if (Controller->FirmwareType == DAC960_V1_Controller) return; - if (RequestSensePool != NULL) - dma_pool_destroy(RequestSensePool); + dma_pool_destroy(RequestSensePool); for (i = 0; i < DAC960_MaxLogicalDrives; i++) { kfree(Controller->V2.LogicalDeviceInformation[i]);