]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/mlx4/mlx4_intr.c
net/mlx4: fix rxq interrupt memory corruption
[dpdk.git] / drivers / net / mlx4 / mlx4_intr.c
index b17d109a369fc4e791611a3d93b91817dadc4052..50d1976985ed73c85bd5aa946d25b5bb431e2358 100644 (file)
@@ -98,7 +98,7 @@ mlx4_rx_intr_vec_enable(struct priv *priv)
        struct rte_intr_handle *intr_handle = &priv->intr_handle;
 
        mlx4_rx_intr_vec_disable(priv);
        struct rte_intr_handle *intr_handle = &priv->intr_handle;
 
        mlx4_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) {
                rte_errno = ENOMEM;
                ERROR("failed to allocate memory for interrupt vector,"
        if (intr_handle->intr_vec == NULL) {
                rte_errno = ENOMEM;
                ERROR("failed to allocate memory for interrupt vector,"