From: John Daley <johndale@cisco.com>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org, John Daley <johndale@cisco.com>
Subject: [dpdk-dev] [PATCH v2] net/enic: fix uninitialized variable
Date: Tue, 17 Apr 2018 17:00:20 -0700 [thread overview]
Message-ID: <20180418000020.6229-1-johndale@cisco.com> (raw)
In-Reply-To: <20180417235324.25315-1-johndale@cisco.com>
A local variable was used without initialization and triggered a
coverity issue.
Is is fixed here, but there is no ill effect of not initializing
the variable in this case. 'rxq_interrupt_offset' is irrelevant
if 'rxq_interrupt_enable' is not set (the condition caught by
coverity).
Fixes: fc2c8c0668fd ("net/enic: use Tx completion index instead of messages")
Coverity issue: 268314
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
v2: fix typo
drivers/net/enic/enic_main.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 822037ce8..2a2269794 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -200,15 +200,14 @@ void enic_init_vnic_resources(struct enic *enic)
unsigned int error_interrupt_enable = 1;
unsigned int error_interrupt_offset = 0;
unsigned int rxq_interrupt_enable = 0;
- unsigned int rxq_interrupt_offset;
+ unsigned int rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET;
unsigned int index = 0;
unsigned int cq_idx;
struct vnic_rq *data_rq;
- if (enic->rte_dev->data->dev_conf.intr_conf.rxq) {
+ if (enic->rte_dev->data->dev_conf.intr_conf.rxq)
rxq_interrupt_enable = 1;
- rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET;
- }
+
for (index = 0; index < enic->rq_count; index++) {
cq_idx = enic_cq_rq(enic, enic_rte_rq_idx_to_sop_idx(index));
--
2.16.2
next prev parent reply other threads:[~2018-04-18 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 23:53 [dpdk-dev] [PATCH] " John Daley
2018-04-18 0:00 ` John Daley [this message]
2018-04-18 17:09 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
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=20180418000020.6229-1-johndale@cisco.com \
--to=johndale@cisco.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/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).