patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Timothy McDaniel <timothy.mcdaniel@intel.com>
To: jerinj@marvell.com
Cc: mattias.ronnblom@ericsson.com, dev@dpdk.org,
	john.mcnamara@intel.com, harry.van.haaren@intel.com,
	timothy.mcdaniel@intel.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH] event/dlb: fix accessing uninitialized variables
Date: Mon, 22 Feb 2021 13:49:07 -0600	[thread overview]
Message-ID: <1614023347-5873-1-git-send-email-timothy.mcdaniel@intel.com> (raw)

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


             reply	other threads:[~2021-02-22 19:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 19:49 Timothy McDaniel [this message]
2021-03-07 15:26 ` [dpdk-stable] [dpdk-dev] " Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1614023347-5873-1-git-send-email-timothy.mcdaniel@intel.com \
    --to=timothy.mcdaniel@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).