From patchwork Tue Feb 14 02:13:08 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: 9571013 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 2078160586 for ; Tue, 14 Feb 2017 02:13:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1107727F9E for ; Tue, 14 Feb 2017 02:13:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05BCE28174; Tue, 14 Feb 2017 02:13:31 +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 60B4427F9E for ; Tue, 14 Feb 2017 02:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751788AbdBNCNV (ORCPT ); Mon, 13 Feb 2017 21:13:21 -0500 Received: from mga11.intel.com ([192.55.52.93]:63267 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751748AbdBNCNS (ORCPT ); Mon, 13 Feb 2017 21:13:18 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2017 18:13:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,158,1484035200"; d="scan'208";a="44015039" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga002.jf.intel.com with ESMTP; 13 Feb 2017 18:13:13 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1cdSeN-000Pxp-ME; Tue, 14 Feb 2017 10:15:27 +0800 Date: Tue, 14 Feb 2017 10:13:08 +0800 From: kbuild test robot To: "Dupuis, Chad" Cc: kbuild-all@01.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, fcoe-devel@open-fcoe.org, netdev@vger.kernel.org, yuval.mintz@cavium.com, QLogic-Storage-Upstream@cavium.com Subject: [PATCH] qedf: fix ifnullfree.cocci warnings Message-ID: <20170214021308.GA24773@intel11.lkp.intel.com> References: <201702141025.qINpoySA%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1487013421-27006-3-git-send-email-chad.dupuis@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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/scsi/qedf/qedf_main.c:2742:2-7: 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: Dupuis, Chad Signed-off-by: Fengguang Wu --- qedf_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -2738,8 +2738,7 @@ static void qedf_free_fcoe_pf_param(stru qedf_free_global_queues(qedf); - if (qedf->global_queues) - kfree(qedf->global_queues); + kfree(qedf->global_queues); } /*