[dpdk-dev] [PATCH v2 2/4] net/mlx5: fix missing validation of null pointer
Dekel Peled
dekelp at mellanox.com
Thu May 2 17:01:55 CEST 2019
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 missing validation where it is missing.
Fixes: af4f09f28294 ("net/mlx5: prefix all functions with mlx5")
Cc: stable at dpdk.org
Signed-off-by: Dekel Peled <dekelp at mellanox.com>
---
drivers/net/mlx5/mlx5_rxq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index db8c340..c9c2a14 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -617,7 +617,8 @@
*/
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);
--
1.8.3.1
More information about the dev
mailing list