net/mlx5: fix rxq interrupt memory corruption
authorShahaf Shuler <shahafs@mellanox.com>
Thu, 9 Nov 2017 13:10:14 +0000 (15:10 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 10 Nov 2017 08:56:26 +0000 (08:56 +0000)
intr_vec allocation size was wrong causing a memory corruption.

Fixes: e1016cb73383 ("net/mlx5: fix Rx interrupts management")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx5/mlx5_rxq.c

index 6b29aae..85399ef 100644 (file)
@@ -331,7 +331,7 @@ priv_rx_intr_vec_enable(struct priv *priv)
        if (!priv->dev->data->dev_conf.intr_conf.rxq)
                return 0;
        priv_rx_intr_vec_disable(priv);
-       intr_handle->intr_vec = malloc(sizeof(intr_handle->intr_vec[rxqs_n]));
+       intr_handle->intr_vec = malloc(n * sizeof(intr_handle->intr_vec[0]));
        if (intr_handle->intr_vec == NULL) {
                ERROR("failed to allocate memory for interrupt vector,"
                      " Rx interrupts will not be supported");