Skip to content

Commit

Permalink
net/dpaa2: fix null pointer dereference
Browse files Browse the repository at this point in the history
[ upstream commit 29e5519 ]

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

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

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
liwg06 authored and kevintraynor committed Feb 21, 2022
1 parent 90386f4 commit 9ac1343
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/dpaa2/dpaa2_ethdev.c
Expand Up @@ -395,6 +395,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",
Expand Down

0 comments on commit 9ac1343

Please sign in to comment.