From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 95DA728BF for ; Wed, 27 Apr 2016 16:08:31 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 27 Apr 2016 07:07:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,541,1455004800"; d="scan'208";a="967632601" Received: from gklab-246-025.igk.intel.com (HELO Sent) ([10.217.246.25]) by fmsmga002.fm.intel.com with SMTP; 27 Apr 2016 07:07:24 -0700 Received: by Sent (sSMTP sendmail emulation); Wed, 27 Apr 2016 17:07:55 +0200 From: Daniel Mrzyglod To: bruce.richardson@intel.com Cc: dev@dpdk.org, Daniel Mrzyglod Date: Wed, 27 Apr 2016 17:07:53 +0200 Message-Id: <1461769673-65483-1-git-send-email-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] lpm6: fix assigned value is garbage or undefined X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 14:08:32 -0000 Fix issue reported by clang scan-build Value of pointer tbl_next was uninitialized. When function lookup_step() take else branch it may provide garbage into tbl = tbl_next; Fixes: 5c510e13a9cb ("lpm: add IPv6 support") Signed-off-by: Daniel Mrzyglod --- lib/librte_lpm/rte_lpm6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c index ba4353c..32fdba0 100644 --- a/lib/librte_lpm/rte_lpm6.c +++ b/lib/librte_lpm/rte_lpm6.c @@ -601,7 +601,7 @@ int rte_lpm6_lookup(const struct rte_lpm6 *lpm, uint8_t *ip, uint8_t *next_hop) { const struct rte_lpm6_tbl_entry *tbl; - const struct rte_lpm6_tbl_entry *tbl_next; + const struct rte_lpm6_tbl_entry *tbl_next = NULL; int status; uint8_t first_byte; uint32_t tbl24_index; @@ -636,7 +636,7 @@ rte_lpm6_lookup_bulk_func(const struct rte_lpm6 *lpm, { unsigned i; const struct rte_lpm6_tbl_entry *tbl; - const struct rte_lpm6_tbl_entry *tbl_next; + const struct rte_lpm6_tbl_entry *tbl_next = NULL; uint32_t tbl24_index; uint8_t first_byte, next_hop; int status; -- 2.5.5