patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru,
	stable@dpdk.org, David Hunt <david.hunt@intel.com>
Subject: [dpdk-stable] [PATCH] mempool: fix ignore return value Coverity issue
Date: Thu,  5 Nov 2020 13:51:14 +0000	[thread overview]
Message-ID: <20201105135114.10920-1-david.hunt@intel.com> (raw)

Coverity flags that rte_mempool_ops_dequeue_bulk() is called without
checking the return value.

This ignoring is intentional, so this patch gets the return code, then
uses RTE_SET_USED so that Coverity will be happy.

Coverity issue: 363744
Fixes: 449c49b93a6b ("mempool: support handler operations")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 lib/librte_mempool/rte_mempool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index b9f3fbd61..2980b1a00 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -270,9 +270,11 @@ rte_mempool_free_memchunks(struct rte_mempool *mp)
 {
 	struct rte_mempool_memhdr *memhdr;
 	void *elt;
+	int ret;
 
 	while (!STAILQ_EMPTY(&mp->elt_list)) {
-		rte_mempool_ops_dequeue_bulk(mp, &elt, 1);
+		ret = rte_mempool_ops_dequeue_bulk(mp, &elt, 1);
+		RTE_SET_USED(ret); /* Intentionally ignored */
 		(void)elt;
 		STAILQ_REMOVE_HEAD(&mp->elt_list, next);
 		mp->populated_size--;
-- 
2.17.1


             reply	other threads:[~2020-11-05 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 13:51 David Hunt [this message]
2020-11-05 13:58 ` Olivier Matz
2020-11-13 14:29   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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=20201105135114.10920-1-david.hunt@intel.com \
    --to=david.hunt@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).