Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756256AbbBCVAg (ORCPT ); Tue, 3 Feb 2015 16:00:36 -0500 Received: from mga01.intel.com ([192.55.52.88]:15163 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755915AbbBCVAe convert rfc822-to-8bit (ORCPT ); Tue, 3 Feb 2015 16:00:34 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,515,1418112000"; d="scan'208";a="646858547" From: "Weiny, Ira" To: "Weiny, Ira" , "Wu, Fengguang" CC: "kbuild-all@01.org" , Roland Dreier , "Hefty, Sean" , Hal Rosenstock , Or Gerlitz , Yan Burman , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] IB/mad: fix ifnullfree.cocci warnings Thread-Topic: [PATCH] IB/mad: fix ifnullfree.cocci warnings Thread-Index: AQHQOnlWYxBDsxzfQka/8MmbazDNmZzfb84AgAADcZA= Date: Tue, 3 Feb 2015 21:00:19 +0000 Message-ID: <2807E5FD2F6FDA4886F6618EAC48510E0CC118B9@CRSMSX101.amr.corp.intel.com> References: <201501280547.wGzvHfd3%fengguang.wu@intel.com> <20150127213555.GA14218@waimea> <2807E5FD2F6FDA4886F6618EAC48510E0CC1181D@CRSMSX101.amr.corp.intel.com> In-Reply-To: <2807E5FD2F6FDA4886F6618EAC48510E0CC1181D@CRSMSX101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.205.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1670 Lines: 52 > > > > drivers/infiniband/core/mad.c:2088: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 > > > > Signed-off-by: Fengguang Wu > > > Signed-off-by: Ira Weiny Sorry this should have been: Reviewed-by: Ira Weiny Tested-by: Ira Weiny > > > > --- > > > > mad.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > --- a/drivers/infiniband/core/mad.c > > +++ b/drivers/infiniband/core/mad.c > > @@ -2084,8 +2084,7 @@ out: > > /* Post another receive request for this QP */ > > if (response) { > > ib_mad_post_receive_mads(qp_info, response); > > - if (recv) > > - kfree(recv); > > + kfree(recv); > > } else > > ib_mad_post_receive_mads(qp_info, recv); } > -- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/