DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] eal: fix dereference before null check
@ 2020-09-19 10:34 wangyunjian
  2020-10-14 17:02 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  2020-10-15  8:42 ` [dpdk-dev] [PATCH v2] eal: fix dereference after " wangyunjian
  0 siblings, 2 replies; 7+ messages in thread
From: wangyunjian @ 2020-09-19 10:34 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, jerinj, hkalra, jerry.lilijun, xudingke,
	Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

This patch fixes (dereference after null check) coverity issue.
The intr_handle may be a null pointer which led to this issue.

Coverity issue: 357695, 357751
Fixes: 05c4105738d8 ("trace: add interrupt tracepoints")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 lib/librte_eal/freebsd/eal_interrupts.c | 6 ++++--
 lib/librte_eal/linux/eal_interrupts.c   | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/freebsd/eal_interrupts.c b/lib/librte_eal/freebsd/eal_interrupts.c
index 6d53d33c8..028ab457a 100644
--- a/lib/librte_eal/freebsd/eal_interrupts.c
+++ b/lib/librte_eal/freebsd/eal_interrupts.c
@@ -380,7 +380,8 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)
 	}
 
 out:
-	rte_eal_trace_intr_enable(intr_handle, rc);
+	if (intr_handle)
+		rte_eal_trace_intr_enable(intr_handle, rc);
 	return rc;
 }
 
@@ -418,7 +419,8 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle)
 		break;
 	}
 out:
-	rte_eal_trace_intr_disable(intr_handle, rc);
+	if (intr_handle)
+		rte_eal_trace_intr_disable(intr_handle, rc);
 	return rc;
 }
 
diff --git a/lib/librte_eal/linux/eal_interrupts.c b/lib/librte_eal/linux/eal_interrupts.c
index 13db5c4e8..e46443873 100644
--- a/lib/librte_eal/linux/eal_interrupts.c
+++ b/lib/librte_eal/linux/eal_interrupts.c
@@ -725,7 +725,8 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)
 		break;
 	}
 out:
-	rte_eal_trace_intr_enable(intr_handle, rc);
+	if (intr_handle)
+		rte_eal_trace_intr_enable(intr_handle, rc);
 	return rc;
 }
 
@@ -852,7 +853,8 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle)
 		break;
 	}
 out:
-	rte_eal_trace_intr_disable(intr_handle, rc);
+	if (intr_handle)
+		rte_eal_trace_intr_disable(intr_handle, rc);
 	return rc;
 }
 
-- 
2.23.0


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

end of thread, other threads:[~2020-10-29 16:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-19 10:34 [dpdk-dev] [PATCH] eal: fix dereference before null check wangyunjian
2020-10-14 17:02 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2020-10-15  2:29   ` wangyunjian
2020-10-15  8:42 ` [dpdk-dev] [PATCH v2] eal: fix dereference after " wangyunjian
2020-10-22 20:01   ` David Marchand
2020-10-28 21:18   ` [dpdk-dev] [EXT] " Harman Kalra
2020-10-29 16:09     ` David Marchand

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://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/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

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


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