DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/dpaa2: fix null pointer dereference
@ 2022-01-25 14:23 Weiguo Li
  2022-01-28 15:12 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Weiguo Li @ 2022-01-25 14:23 UTC (permalink / raw)
  To: hemant.agrawal; +Cc: nipun.gupta, dev

Check for memory allocation failure is added to avoid null
pointer dereference.

Fixes: 4690a6114ff6 ("net/dpaa2: enable error queues optionally")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 09105f049e..379daec5f4 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -399,6 +399,8 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
 	if (dpaa2_enable_err_queue) {
 		priv->rx_err_vq = rte_zmalloc("dpni_rx_err",
 			sizeof(struct dpaa2_queue), 0);
+		if (!priv->rx_err_vq)
+			goto fail;
 
 		dpaa2_q = (struct dpaa2_queue *)priv->rx_err_vq;
 		dpaa2_q->q_storage = rte_malloc("err_dq_storage",
-- 
2.25.1


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

* Re: [PATCH] net/dpaa2: fix null pointer dereference
  2022-01-25 14:23 [PATCH] net/dpaa2: fix null pointer dereference Weiguo Li
@ 2022-01-28 15:12 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2022-01-28 15:12 UTC (permalink / raw)
  To: Weiguo Li, hemant.agrawal; +Cc: nipun.gupta, dev

On 1/25/2022 2:23 PM, Weiguo Li wrote:
> Check for memory allocation failure is added to avoid null
> pointer dereference.
> 
> Fixes: 4690a6114ff6 ("net/dpaa2: enable error queues optionally")
> 
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.

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

end of thread, other threads:[~2022-01-28 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 14:23 [PATCH] net/dpaa2: fix null pointer dereference Weiguo Li
2022-01-28 15:12 ` Ferruh Yigit

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).