patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Timothy McDaniel <timothy.mcdaniel@intel.com>
To: Gage Eads <gage.eads@intel.com>
Cc: dev@dpdk.org, erik.g.carrillo@intel.com,
	harry.van.haaren@intel.com, jerinj@marvell.com,
	john.mcnamara@dpdk.org, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 3/4] event/dlb2: fix dereference NULL pointer Coverity warning
Date: Thu,  5 Nov 2020 15:22:52 -0600
Message-ID: <1604611374-2072-2-git-send-email-timothy.mcdaniel@intel.com> (raw)
In-Reply-To: <1604611374-2072-1-git-send-email-timothy.mcdaniel@intel.com>

Add NULL check before using t->mbuf_pool.

Fixes: 6f1b828 ("event/dlb2: add self-tests")
Coverity issue: 363719
Cc: stable@dpdk.org

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/dlb2_selftest.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/event/dlb2/dlb2_selftest.c b/drivers/event/dlb2/dlb2_selftest.c
index e300067..f433654 100644
--- a/drivers/event/dlb2/dlb2_selftest.c
+++ b/drivers/event/dlb2/dlb2_selftest.c
@@ -212,7 +212,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.6.4


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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 21:22 [dpdk-stable] [PATCH 4/4] event/dlb2: add missing sections to documentation Timothy McDaniel
2020-11-05 21:22 ` Timothy McDaniel [this message]
2020-11-05 21:22 ` [dpdk-stable] [PATCH 1/4] event/dlb: fix memory overrun Coverity warning Timothy McDaniel
2020-11-10 15:36   ` [dpdk-stable] [dpdk-dev] " Jerin Jacob
2020-11-10 15:44     ` McDaniel, Timothy
2020-11-05 21:22 ` [dpdk-stable] [PATCH 2/4] event/dlb: fix no-effect " Timothy McDaniel

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=1604611374-2072-2-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=john.mcnamara@dpdk.org \
    --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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git