]> git.droids-corp.org - dpdk.git/commitdiff
stack: fix uninitialized variable
authorYunjian Wang <wangyunjian@huawei.com>
Fri, 25 Sep 2020 05:00:50 +0000 (13:00 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 30 Sep 2020 19:08:39 +0000 (21:08 +0200)
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 <wangyunjian@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/librte_stack/rte_stack_lf_generic.h

index 3abbb53428b244014ac38fd9adc8efb5f4a46be9..4850a05ee7ab1ca239c7b30e0633a424bc9f7560 100644 (file)
@@ -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) {