DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference
@ 2020-11-16 17:40 Timothy McDaniel
  2020-11-20 10:03 ` Mcnamara, John
  0 siblings, 1 reply; 3+ messages in thread
From: Timothy McDaniel @ 2020-11-16 17:40 UTC (permalink / raw)
  Cc: dev, erik.g.carrillo, gage.eads, harry.van.haaren, jerinj, thomas

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference
  2020-11-16 17:40 [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference Timothy McDaniel
@ 2020-11-20 10:03 ` Mcnamara, John
  2020-11-20 12:25   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Mcnamara, John @ 2020-11-20 10:03 UTC (permalink / raw)
  To: McDaniel, Timothy, jerinj
  Cc: dev, Carrillo, Erik G, Eads, Gage, Van Haaren,  Harry, thomas



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Timothy McDaniel
> Sent: Monday, November 16, 2020 5:41 PM
> Cc: dev@dpdk.org; Carrillo, Erik G <erik.g.carrillo@intel.com>; Eads, Gage
> <gage.eads@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>;
> jerinj@marvell.com; thomas@monjalon.net
> Subject: [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference
> 
> Add NULL check before using t->mbuf_pool.
> 
> Coverity issue: 363719
> Fixes: 83326 ("event/dlb: add PMD self-tests")

This is similar to a fix on the dlb2 driver which fixed a similar Coverity defect (according to the last Coverity run). So, on that basis, I'll ack this patch.

Jerin, could you try merge this for RC5 if possible.


Acked-by: John McNamara <john.mcnamara@intel.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference
  2020-11-20 10:03 ` Mcnamara, John
@ 2020-11-20 12:25   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2020-11-20 12:25 UTC (permalink / raw)
  To: Mcnamara, John
  Cc: McDaniel, Timothy, jerinj, dev, Carrillo, Erik G, Eads, Gage,
	Van Haaren, Harry, thomas

On Fri, Nov 20, 2020 at 3:33 PM Mcnamara, John <john.mcnamara@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Timothy McDaniel
> > Sent: Monday, November 16, 2020 5:41 PM
> > Cc: dev@dpdk.org; Carrillo, Erik G <erik.g.carrillo@intel.com>; Eads, Gage
> > <gage.eads@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>;
> > jerinj@marvell.com; thomas@monjalon.net
> > Subject: [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference
> >
> > Add NULL check before using t->mbuf_pool.
> >
> > Coverity issue: 363719
> > Fixes: 83326 ("event/dlb: add PMD self-tests")
>
> This is similar to a fix on the dlb2 driver which fixed a similar Coverity defect (according to the last Coverity run). So, on that basis, I'll ack this patch.
>
> Jerin, could you try merge this for RC5 if possible.
>


Applied to dpdk-next-net-eventdev/for-main. Thanks


>
> Acked-by: John McNamara <john.mcnamara@intel.com>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 17:40 [dpdk-dev] [PATCH] event/dlb: fix potential NULL dereference Timothy McDaniel
2020-11-20 10:03 ` Mcnamara, John
2020-11-20 12:25   ` Jerin Jacob

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/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 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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