在 2021/4/22 23:20, Stephen Hemminger 写道:
On Thu, 22 Apr 2021 19:27:14 +0800
"Min Hu (Connor)" <humi...@huawei.com> wrote:

diff --git a/drivers/net/tap/tap_intr.c b/drivers/net/tap/tap_intr.c
index 5cf4f17..1cacc15 100644
--- a/drivers/net/tap/tap_intr.c
+++ b/drivers/net/tap/tap_intr.c
@@ -59,7 +59,7 @@ tap_rx_intr_vec_install(struct rte_eth_dev *dev)
if (!dev->data->dev_conf.intr_conf.rxq)
                return 0;
-       intr_handle->intr_vec = malloc(sizeof(intr_handle->intr_vec[rxqs_n]));
+       intr_handle->intr_vec = malloc(sizeof(int) * rxqs_n);

Maybe calloc() here would be good idea?

Hi, Stephen,
        No need to use calloc, because members of
 'intr_handle->intr_vec' array will be set new
value.

Reply via email to