]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: fix missing validation of null pointer
authorDekel Peled <dekelp@mellanox.com>
Wed, 8 May 2019 08:29:39 +0000 (11:29 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 24 May 2019 12:56:36 +0000 (14:56 +0200)
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 <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5_rxq.c

index 83ba525e676620c5d8ac4e426f997e0406e4f692..f595e7a52b9af6f65cc4b3e876acb708ea15600f 100644 (file)
@@ -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);