[dpdk-dev] [PATCH 5/6] net/bnxt: fix interrupt vector array initialization

Ajit Khaparde ajit.khaparde at broadcom.com
Sat Jun 8 21:22:07 CEST 2019


From: Naresh Kumar PBS <nareshkumar.pbs at broadcom.com>

Initialize the vector array when it is valid, thereby
preventing a case were it may be accessed when
the array is unallocated

Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")

Signed-off-by: Naresh Kumar PBS <nareshkumar.pbs at broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 4133d0bef..4dd845992 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -412,13 +412,12 @@ static int bnxt_init_chip(struct bnxt *bp)
 			"intr_handle->nb_efd = %d intr_handle->max_intr = %d\n",
 			 intr_handle->intr_vec, intr_handle->nb_efd,
 			intr_handle->max_intr);
-	}
-
-	for (queue_id = 0; queue_id < bp->eth_dev->data->nb_rx_queues;
-	     queue_id++) {
-		intr_handle->intr_vec[queue_id] = vec;
-		if (vec < base + intr_handle->nb_efd - 1)
-			vec++;
+		for (queue_id = 0; queue_id < bp->eth_dev->data->nb_rx_queues;
+		     queue_id++) {
+			intr_handle->intr_vec[queue_id] = vec;
+			if (vec < base + intr_handle->nb_efd - 1)
+				vec++;
+		}
 	}
 
 	/* enable uio/vfio intr/eventfd mapping */
-- 
2.20.1 (Apple Git-117)



More information about the dev mailing list