From: Shahaf Shuler Date: Tue, 17 Oct 2017 12:04:56 +0000 (+0300) Subject: net/mlx5: fix segfault on interrupt disable X-Git-Tag: spdx-start~1160 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8d92964180df64b320952a3fcf407934a76d936f;p=dpdk.git net/mlx5: fix segfault on interrupt disable Interrupt disable can be called when the interrupt vector is not yet allocated. Such case ends up with segmentation fault. Fixing it by adding verification for interrupt vector validity. Fixes: 09cb5b581762 ("net/mlx5: separate DPDK from verbs Rx queue objects") Signed-off-by: Shahaf Shuler Acked-by: Nelio Laranjeiro --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index ad741ef448..2beebfdf21 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -396,6 +396,8 @@ priv_rx_intr_vec_disable(struct priv *priv) if (!priv->dev->data->dev_conf.intr_conf.rxq) return; + if (!intr_handle->intr_vec) + goto free; for (i = 0; i != n; ++i) { struct mlx5_rxq_ctrl *rxq_ctrl; struct mlx5_rxq_data *rxq_data; @@ -411,8 +413,10 @@ priv_rx_intr_vec_disable(struct priv *priv) rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq); mlx5_priv_rxq_ibv_release(priv, rxq_ctrl->ibv); } +free: rte_intr_free_epoll_fd(intr_handle); - free(intr_handle->intr_vec); + if (intr_handle->intr_vec) + free(intr_handle->intr_vec); intr_handle->nb_efd = 0; intr_handle->intr_vec = NULL; }