summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2014-12-05 15:57:12 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-12-05 22:09:23 +0100
commitdc018ce69ba30083e75a0cbfe73d8ec6a630f9c5 (patch)
tree87f04bc4665cb1e1e6e259e68f6ec9b0575dd355
parent06554d0240c33d972b3a15efbe43e61e09c46d13 (diff)
downloaddpdk-dc018ce69ba30083e75a0cbfe73d8ec6a630f9c5.zip
dpdk-dc018ce69ba30083e75a0cbfe73d8ec6a630f9c5.tar.gz
dpdk-dc018ce69ba30083e75a0cbfe73d8ec6a630f9c5.tar.xz
enic: fix uninitialized variable
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 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> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
-rw-r--r--lib/librte_pmd_enic/vnic/vnic_dev.c2
1 files changed, 1 insertions, 1 deletions
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;