From: Dekel Peled Date: Wed, 8 May 2019 08:29:39 +0000 (+0300) Subject: net/mlx5: fix missing validation of null pointer X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3a3d398280bb5113caa5aa6ada6704792ea88c36;p=dpdk.git net/mlx5: fix missing validation of null pointer Function mlx5_rxq_ibv_release() is called in several places. Before each call except one, the input parameter is validated to make sure it is not null. This patch adds the validation where it is missing. It also changes a priv_ prefix, left in a comment, to mlx5_ prefix. Fixes: af4f09f28294 ("net/mlx5: prefix all functions with mlx5") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Shahaf Shuler Acked-by: Yongseok Koh --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 83ba525e67..f595e7a52b 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -593,11 +593,12 @@ mlx5_rx_intr_vec_disable(struct rte_eth_dev *dev) continue; /** * Need to access directly the queue to release the reference - * kept in priv_rx_intr_vec_enable(). + * kept in mlx5_rx_intr_vec_enable(). */ rxq_data = (*priv->rxqs)[i]; rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq); - mlx5_rxq_ibv_release(rxq_ctrl->ibv); + if (rxq_ctrl->ibv) + mlx5_rxq_ibv_release(rxq_ctrl->ibv); } free: rte_intr_free_epoll_fd(intr_handle);