From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>,
cristian.dumitrescu@intel.com
Cc: dev@dpdk.org
Subject: Re: [PATCH] sched: fix useless call
Date: Tue, 10 May 2016 18:06:08 +0100 [thread overview]
Message-ID: <57321500.6030906@intel.com> (raw)
In-Reply-To: <1462875064-119474-1-git-send-email-danielx.t.mrzyglod@intel.com>
On 5/10/2016 11:11 AM, Daniel Mrzyglod wrote:
> Fix issue reported by Coverity.
> Coverity ID 13338
>
> A function call that seems to have an intended effect has no actual effect
> on the logic of the program.
>
> In rte_sched_port_free: A function is called that is only useful for its
> return value, and this value is ignored.
>
> Fixes: de3cfa2c9823 ("sched: initial import")
>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> ---
> lib/librte_sched/rte_sched.c | 1 -
> 1 file changed, 1 deletion(-)
>
> 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]);
> }
>
> - rte_bitmap_free(port->bmp);
> rte_free(port);
> }
>
>
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 <ferruh.yigit@intel.com>"
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
next prev parent reply other threads:[~2016-05-10 17:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 10:11 [PATCH] sched: fix useless call Daniel Mrzyglod
2016-05-10 17:06 ` Ferruh Yigit [this message]
2016-05-10 17:18 ` Dumitrescu, Cristian
2016-05-11 9:46 ` Ferruh Yigit
2016-05-13 10:12 ` Thomas Monjalon
2016-05-13 11:04 ` Dumitrescu, Cristian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57321500.6030906@intel.com \
--to=ferruh.yigit@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=danielx.t.mrzyglod@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.