From: Yongseok Koh Date: Tue, 30 May 2017 01:02:59 +0000 (-0700) Subject: net/mlx5: fix exception handling X-Git-Tag: spdx-start~3087 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=70aee77ec6284d18ae30486b545b0527c2082bce;p=dpdk.git net/mlx5: fix exception handling A sanity check is required in priv_fdir_disable(). If resizing Rx queue fails, this can cause a crash by referencing a NULL pointer. Fixes: 76f5c99e6840 ("mlx5: support flow director") Fixes: 0cdddf4d0626 ("net/mlx5: split Rx queue structure") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_fdir.c b/drivers/net/mlx5/mlx5_fdir.c index f80c58b4dd..1cff41bab9 100644 --- a/drivers/net/mlx5/mlx5_fdir.c +++ b/drivers/net/mlx5/mlx5_fdir.c @@ -733,9 +733,11 @@ priv_fdir_disable(struct priv *priv) /* Destroy flow director context in each RX queue. */ for (i = 0; (i != priv->rxqs_n); i++) { - struct rxq_ctrl *rxq_ctrl = - container_of((*priv->rxqs)[i], struct rxq_ctrl, rxq); + struct rxq_ctrl *rxq_ctrl; + if (!(*priv->rxqs)[i]) + continue; + rxq_ctrl = container_of((*priv->rxqs)[i], struct rxq_ctrl, rxq); if (!rxq_ctrl->fdir_queue) continue; priv_fdir_queue_destroy(priv, rxq_ctrl->fdir_queue);