From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org, ssujith@cisco.com
Subject: [dpdk-dev] [PATCH 2/2] enic: fix error with uninitialized variable.
Date: Fri, 5 Dec 2014 15:57:12 +0000 [thread overview]
Message-ID: <1417795032-23524-3-git-send-email-bruce.richardson@intel.com> (raw)
In-Reply-To: <1417795032-23524-1-git-send-email-bruce.richardson@intel.com>
The variable notify_pa is only initialized inside one branch of
an if statement, triggering a compiler error with clang 3.3 on FreeBSD.
CC vnic/vnic_dev.o
/usr/home/bruce/dpdk.org/lib/librte_pmd_enic/vnic/vnic_dev.c:777:6: fatal error: variable 'notify_pa'
is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!vnic_dev_in_reset(vdev)) {
Fix this issue by adding "= 0" to the variable definition.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_pmd_enic/vnic/vnic_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.c b/lib/librte_pmd_enic/vnic/vnic_dev.c
index 21d5521..b1cd63f 100644
--- a/lib/librte_pmd_enic/vnic/vnic_dev.c
+++ b/lib/librte_pmd_enic/vnic/vnic_dev.c
@@ -764,7 +764,7 @@ int vnic_dev_notify_setcmd(struct vnic_dev *vdev,
int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)
{
void *notify_addr = NULL;
- dma_addr_t notify_pa;
+ dma_addr_t notify_pa = 0;
char name[NAME_MAX];
static u32 instance;
--
2.1.0
next prev parent reply other threads:[~2014-12-05 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 15:57 [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson
2014-12-05 15:57 ` Bruce Richardson [this message]
2014-12-05 21:11 ` [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Thomas Monjalon
2014-12-07 15:21 ` Sujith Sankar (ssujith)
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=1417795032-23524-3-git-send-email-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=ssujith@cisco.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).