From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F677A04C0; Fri, 25 Sep 2020 07:01:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 92EA91D428; Fri, 25 Sep 2020 07:01:47 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id 998631D424; Fri, 25 Sep 2020 07:01:46 +0200 (CEST) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D68DFE5D2CD0379F8458; Fri, 25 Sep 2020 13:01:44 +0800 (CST) Received: from localhost (10.174.185.168) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Fri, 25 Sep 2020 13:01:37 +0800 From: wangyunjian To: CC: , , , , Yunjian Wang , Date: Fri, 25 Sep 2020 13:00:50 +0800 Message-ID: <389c3874a5bc2db3056b222ec48c860b96f7ad67.1601009974.git.wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.185.168] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] stack: fix possible uninitialized success variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Yunjian Wang This patch fixes an issue that uninitialized 'success' is used to be compared with '0'. Coverity issue: 337676 Fixes: 3340202f5954 ("stack: add lock-free implementation") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- lib/librte_stack/rte_stack_lf_generic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_stack/rte_stack_lf_generic.h b/lib/librte_stack/rte_stack_lf_generic.h index 3abbb5342..4850a05ee 100644 --- a/lib/librte_stack/rte_stack_lf_generic.h +++ b/lib/librte_stack/rte_stack_lf_generic.h @@ -78,7 +78,7 @@ __rte_stack_lf_pop_elems(struct rte_stack_lf_list *list, struct rte_stack_lf_elem **last) { struct rte_stack_lf_head old_head; - int success; + int success = 0; /* Reserve num elements, if available */ while (1) { -- 2.23.0