vlib: Coverity fix 66/27466/3
authorDave Barach <dave@barachs.net>
Mon, 8 Jun 2020 13:40:36 +0000 (09:40 -0400)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 8 Jun 2020 15:54:56 +0000 (15:54 +0000)
Fix a nit warning: we're not likely to create a vlib process with more
than 4gb of stack.

Type: fix
Ticket: VPP-1888

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8bc7f64287c2802b0c286ce3d04443ac723a9a33

src/vlib/node.c

index 2e93b95..3838d95 100644 (file)
@@ -446,7 +446,7 @@ register_node (vlib_main_t * vm, vlib_node_registration_t * r)
        clib_memset (p, 0, sizeof (p[0]));
        p->log2_n_stack_bytes = log2_n_stack_bytes;
 
-       stack_bytes = 1 << log2_n_stack_bytes;
+       stack_bytes = 1ULL << log2_n_stack_bytes;
        /* map stack size + 2 extra guard pages */
        map = mmap (0, stack_bytes + page_size, PROT_READ | PROT_WRITE,
                    mmap_flags, -1, 0);