event/dlb: fix accessing uninitialized variables
PATCH 1/1 event/dlb: fix accessing uninitialized variables
This patch updates the PMD to initialize response fields prior to calling into the PF layer.
Coverity issue: 366187, 366186, 366184, 366166, 366159,
366158, 366153, 366145, 366127, 366125, 366120
Fixes 8bb077f44ef2 ("event/dlb: add port unlink and unlinks in progress")
Fixes 6a89b28f8163 ("event/dlb: add port link")
Fixes eb14a3421afd ("event/dlb: add eventdev start")
Fixes b94c709decbe ("event/dlb: add infos get and configure")
Fixes f7a9172f36b4 ("event/dlb: add queue setup")
Signed-off-by Timothy McDaniel <[email protected]>
--- drivers/event/dlb/dlb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/event/dlb/dlb.c +11 -11
@@ -382,7 +382,7 @@ struct process_local_port_data dlb_ldb_credit_pool_create(struct dlb_hw_dev *handle) {struct dlb_create_ldb_pool_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int ret;if (handle ==NULL )
@@ -414,7 +414,7 @@ struct process_local_port_data dlb_dir_credit_pool_create(struct dlb_hw_dev *handle) {struct dlb_create_dir_pool_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int ret;if (handle ==NULL )
@@ -447,7 +447,7 @@ struct process_local_port_data {int ret =0 ;struct dlb_create_sched_domain_args *config_params; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };if (resources_asked ==NULL ) {DLB_LOG_ERR ("dlb: dlb_create NULL parameter\n" );
@@ -711,7 +711,7 @@ struct process_local_port_data uint16_t qm_qid) {struct dlb_unmap_qid_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int32_t ret;if (handle ==NULL )
@@ -841,7 +841,7 @@ struct process_local_port_datastruct dlb_eventdev *dlb;struct dlb_hw_dev *handle;struct dlb_pending_port_unmaps_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int ret;RTE_SET_USED (dev);
@@ -1253,7 +1253,7 @@ struct process_local_port_data {struct dlb_hw_dev *handle = &dlb->qm_instance;struct dlb_create_ldb_queue_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int32_t ret;uint32_t qm_qid;int sched_type =-1 ;
@@ -1309,7 +1309,7 @@ struct process_local_port_data {struct dlb_hw_dev *handle = &dlb->qm_instance;struct dlb_get_sn_allocation_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int ret; cfg.group = group;
@@ -1330,7 +1330,7 @@ struct process_local_port_data {struct dlb_hw_dev *handle = &dlb->qm_instance;struct dlb_set_sn_allocation_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int ret; cfg.num = num;
@@ -1352,7 +1352,7 @@ struct process_local_port_data {struct dlb_hw_dev *handle = &dlb->qm_instance;struct dlb_get_sn_occupancy_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int ret; cfg.group = group;
@@ -1893,7 +1893,7 @@ static int dlb_num_dir_queues_setup(struct dlb_eventdev *dlb) uint8_t priority) {struct dlb_map_qid_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int32_t ret;if (handle ==NULL )
@@ -2121,7 +2121,7 @@ static int dlb_num_dir_queues_setup(struct dlb_eventdev *dlb)struct dlb_eventdev *dlb =dlb_pmd_priv (dev);struct dlb_hw_dev *handle = &dlb->qm_instance;struct dlb_start_domain_args cfg; -struct dlb_cmd_response response; +struct dlb_cmd_response response = {0 };int ret, i;rte_spinlock_lock (&dlb->qm_instance.resource_lock);
Signature · 1 line
1.7.10
Quoted 6 lines · Timothy McDaniel
This patch updates the PMD to initialize response fields prior to calling into the PF layer.
Coverity issue: 366187, 366186, 366184, 366166, 366159,
366158, 366153, 366145, 366127, 366125, 366120
Quoted 8 lines
Fixes 8bb077f44ef2 ("event/dlb: add port unlink and unlinks in progress")Fixes 6a89b28f8163 ("event/dlb: add port link")Fixes eb14a3421afd ("event/dlb: add eventdev start")Fixes b94c709decbe ("event/dlb: add infos get and configure")Fixes f7a9172f36b4 ("event/dlb: add queue setup")Signed-off-by Timothy McDaniel <[email protected]>
Since event/dlb/ will be removed from this release. I am marking this patch as "Not applicable" for main treee, Stable maintainer can pull this patch to the stable tree.