DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] event/dlb: fix accessing uninitialized variables
@ 2021-02-22 19:49 Timothy McDaniel
  0 siblings, 0 replies; only message in thread
From: Timothy McDaniel @ 2021-02-22 19:49 UTC (permalink / raw)
  To: jerinj
  Cc: mattias.ronnblom, dev, john.mcnamara, harry.van.haaren,
	timothy.mcdaniel, stable

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")
Cc: stable@dpdk.org

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb/dlb.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c
index 8b26d1d..18bd19c 100644
--- a/drivers/event/dlb/dlb.c
+++ b/drivers/event/dlb/dlb.c
@@ -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_data
 	struct 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);
-- 
1.7.10


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-22 19:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 19:49 [dpdk-dev] [PATCH] event/dlb: fix accessing uninitialized variables Timothy McDaniel

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git