From: Timothy McDaniel <timothy.mcdaniel@intel.com>
Cc: dev@dpdk.org, erik.g.carrillo@intel.com, gage.eads@intel.com,
harry.van.haaren@intel.com, jerinj@marvell.com,
thomas@monjalon.net
Subject: [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference
Date: Mon, 16 Nov 2020 11:40:38 -0600 [thread overview]
Message-ID: <1605548439-31240-1-git-send-email-timothy.mcdaniel@intel.com> (raw)
Add NULL check before using t->mbuf_pool.
Coverity issue: 363719
Fixes: 83326 ("event/dlb: add PMD self-tests")
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
drivers/event/dlb/dlb_selftest.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/event/dlb/dlb_selftest.c b/drivers/event/dlb/dlb_selftest.c
index b9ef778c1..8ab00ba87 100644
--- a/drivers/event/dlb/dlb_selftest.c
+++ b/drivers/event/dlb/dlb_selftest.c
@@ -202,7 +202,12 @@ test_stop_flush(struct test *t) /* test to check we can properly flush events */
goto err;
}
- count = rte_mempool_avail_count(t->mbuf_pool);
+ if (t->mbuf_pool)
+ count = rte_mempool_avail_count(t->mbuf_pool);
+ else {
+ printf("%d: mbuf_pool is NULL\n", __LINE__);
+ goto err;
+ }
if (rte_event_port_attr_get(evdev,
0,
--
2.23.0
next reply other threads:[~2020-11-16 17:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 17:40 Timothy McDaniel [this message]
2020-11-20 10:03 ` Mcnamara, John
2020-11-20 12:25 ` Jerin Jacob
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=1605548439-31240-1-git-send-email-timothy.mcdaniel@intel.com \
--to=timothy.mcdaniel@intel.com \
--cc=dev@dpdk.org \
--cc=erik.g.carrillo@intel.com \
--cc=gage.eads@intel.com \
--cc=harry.van.haaren@intel.com \
--cc=jerinj@marvell.com \
--cc=thomas@monjalon.net \
/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).