From patchwork Tue Dec 8 02:10:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 7793541 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AC58EBEEE5 for ; Tue, 8 Dec 2015 02:12:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C730720497 for ; Tue, 8 Dec 2015 02:12:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCE3E20570 for ; Tue, 8 Dec 2015 02:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932193AbbLHCMF (ORCPT ); Mon, 7 Dec 2015 21:12:05 -0500 Received: from mga09.intel.com ([134.134.136.24]:56925 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755549AbbLHCME (ORCPT ); Mon, 7 Dec 2015 21:12:04 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 07 Dec 2015 18:11:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,397,1444719600"; d="scan'208";a="702264871" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga003.jf.intel.com with ESMTP; 07 Dec 2015 18:11:41 -0800 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1a67kh-000T7D-37; Tue, 08 Dec 2015 10:11:39 +0800 Date: Tue, 8 Dec 2015 10:10:42 +0800 From: kbuild test robot To: Himanshu Madhani Cc: kbuild-all@01.org, target-devel@vger.kernel.org, nab@linux-iscsi.org, giridhar.malavali@qlogic.com, linux-scsi@vger.kernel.org, himanshu.madhani@qlogic.com Subject: [PATCH] qla2xxx: fix ifnullfree.cocci warnings Message-ID: <20151208021042.GA70165@lkp-ib04> References: <201512081044.PEibFacT%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1449535747-2850-6-git-send-email-himanshu.madhani@qlogic.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-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/scsi/qla2xxx/qla_iocb.c:2022: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: Himanshu Madhani Signed-off-by: Fengguang Wu --- qla_iocb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2018,8 +2018,7 @@ qla2x00_els_dcmd_sp_free(void *ptr, void srb_t *sp = (srb_t *)data; struct srb_iocb *elsio = &sp->u.iocb_cmd; - if (sp->fcport) - kfree(sp->fcport); + kfree(sp->fcport); if (elsio->u.els_logo.els_logo_pyld) dma_free_coherent(&ha->pdev->dev, DMA_POOL_SIZE,