From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] sched: fix useless call Date: Tue, 10 May 2016 18:06:08 +0100 Message-ID: <57321500.6030906@intel.com> References: <1462875064-119474-1-git-send-email-danielx.t.mrzyglod@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Daniel Mrzyglod , cristian.dumitrescu@intel.com Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id A70949AB7 for ; Tue, 10 May 2016 19:06:42 +0200 (CEST) In-Reply-To: <1462875064-119474-1-git-send-email-danielx.t.mrzyglod@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 5/10/2016 11:11 AM, Daniel Mrzyglod wrote: > Fix issue reported by Coverity. > Coverity ID 13338 >=20 > A function call that seems to have an intended effect has no actual eff= ect > on the logic of the program. >=20 > In rte_sched_port_free: A function is called that is only useful for it= s > return value, and this value is ignored. >=20 > Fixes: de3cfa2c9823 ("sched: initial import") >=20 > Signed-off-by: Daniel Mrzyglod > --- > lib/librte_sched/rte_sched.c | 1 - > 1 file changed, 1 deletion(-) >=20 > diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.= c > index 1609ea8..9b962a6 100644 > --- a/lib/librte_sched/rte_sched.c > +++ b/lib/librte_sched/rte_sched.c > @@ -749,7 +749,6 @@ rte_sched_port_free(struct rte_sched_port *port) > rte_pktmbuf_free(mbufs[i]); > } > =20 > - rte_bitmap_free(port->bmp); > rte_free(port); > } > =20 >=20 rte_bitmap_free() just does NULL check on port->bmp. I thought intention can be to free the "bmp", but this isn't the case: port->bmp is actually port->bmp_array, port->bmp_array points somewhere within port->memory, port->memory (zero sized array) allocated and freed with "port" pointer. So for this patch: Acked-by: "Ferruh Yigit " But as follow up: rte_bitmap_free() seems only used here, and it does nothing more than NULL check, with a misleading name, should we remove this function? Regards, ferruh