From patchwork Mon Apr 4 19:11:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 8743731 Return-Path: X-Original-To: patchwork-linux-rdma@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 2FC7EC0553 for ; Mon, 4 Apr 2016 19:12:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E606201C8 for ; Mon, 4 Apr 2016 19:12:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7975020225 for ; Mon, 4 Apr 2016 19:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756272AbcDDTMb (ORCPT ); Mon, 4 Apr 2016 15:12:31 -0400 Received: from mga14.intel.com ([192.55.52.115]:51143 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756267AbcDDTMa (ORCPT ); Mon, 4 Apr 2016 15:12:30 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 04 Apr 2016 12:12:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,441,1455004800"; d="scan'208";a="938069176" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga001.fm.intel.com with ESMTP; 04 Apr 2016 12:12:28 -0700 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1an9vD-00009C-Ih; Tue, 05 Apr 2016 03:12:23 +0800 Date: Tue, 5 Apr 2016 03:11:51 +0800 From: kbuild test robot To: "Nicholas A. Bellinger" Cc: kbuild-all@01.org, target-devel , linux-rdma , Bart Van Assche , Sagi Grimberg , Doug Ledford , Nicholas Bellinger Subject: [PATCH] ib_srpt: fix ifnullfree.cocci warnings Message-ID: <20160404191151.GA173438@lkp-ib04> References: <201604050303.V0jVrIjf%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1459794233-19187-1-git-send-email-nab@linux-iscsi.org> 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-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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/infiniband/ulp/srpt/ib_srpt.c:1987:3-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: Nicholas Bellinger Signed-off-by: Fengguang Wu --- ib_srpt.c | 3 +-- 1 file changed, 1 insertion(+), 2 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/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1983,8 +1983,7 @@ static void srpt_free_sess_cmd_map_res(s if (!ib_dma_mapping_error(sdev->device, ioctx->ioctx.dma)) ib_dma_unmap_single(sdev->device, ioctx->ioctx.dma, dma_size, DMA_TO_DEVICE); - if (ioctx->ioctx.buf) - kfree(ioctx->ioctx.buf); + kfree(ioctx->ioctx.buf); } }