Skip to contentSkip to conversation

event/dlb: fix bugs due to accessing uninitialized variables

PATCH In review Timothy McDaniel 2 participants 2 messages Feb 3, 2021 – Feb 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event/dlb: fix bugs due to accessing uninitialized variables

This patch updates the PMD to initialize response fields prior to calling into the PF layer.

Fixes the following coverity issues:

Fixes eb14a3421afd ("event/dlb: add eventdev start")

Coverity issue: 366205

Fixes f0073621940c ("event/dlb: add eventdev stop and close")

Coverity issue: 366202

Fixes f0073621940c ("event/dlb: add eventdev stop and close")

Coverity issue: 366200

---
 drivers/event/dlb/dlb.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/event/dlb/dlb.c +3 -3
index 64e6df7..8b26d1d 100644
@@ -1847,7 +1847,7 @@ static int dlb_num_dir_queues_setup(struct dlb_eventdev *dlb)
 {
 	struct dlb_hw_dev *handle = &dlb->qm_instance;
 	struct dlb_create_dir_queue_args cfg;
-	struct dlb_cmd_response response;
+	struct dlb_cmd_response response = {0};
 	int32_t ret;
 
 	cfg.response = (uintptr_t)&response;
@@ -3573,7 +3573,7 @@ static int dlb_num_dir_queues_setup(struct dlb_eventdev *dlb)
 {
 	struct dlb_hw_dev *handle = &dlb->qm_instance;
 	struct dlb_get_ldb_queue_depth_args cfg;
-	struct dlb_cmd_response response;
+	struct dlb_cmd_response response = {0};
 	int ret;
 
 	cfg.queue_id = queue->qm_queue.id;
@@ -3595,7 +3595,7 @@ static int dlb_num_dir_queues_setup(struct dlb_eventdev *dlb)
 {
 	struct dlb_hw_dev *handle = &dlb->qm_instance;
 	struct dlb_get_dir_queue_depth_args cfg;
-	struct dlb_cmd_response response;
+	struct dlb_cmd_response response = {0};
 	int ret;
 
 	cfg.queue_id = queue->qm_queue.id;
Signature · 1 line
1.7.10
#1 lore raw
Quoted 9 lines · Timothy McDaniel

This patch updates the PMD to initialize response fields prior to calling into the PF layer.

Fixes the following coverity issues:

Fixes eb14a3421afd ("event/dlb: add eventdev start")

Coverity issue: 366205

Quoted 7 lines
Fixes f0073621940c ("event/dlb: add eventdev stop and close")

Coverity issue: 366202

Fixes f0073621940c ("event/dlb: add eventdev stop and close")

Coverity issue: 366200

Please increment the patch version when you send a new version.

Fixed ./devtools/check-git-log.sh issues and Applied to dpdk-next-eventdev/for-main for rc3. Thanks.