From ea977ff1cb0b8afe03e994b3a8346696cbf27ea2 Mon Sep 17 00:00:00 2001 From: Daniel Mrzyglod Date: Fri, 15 Apr 2016 17:29:40 +0200 Subject: [PATCH] examples/exception_path: fix shift operation in lcore setup CID: #30688 The operaton may have an undefined behavior or yield to an unexpected result. In setup_port_lcore_affinities: A bit shift operation has a shift amount which is too large or has a negative value. Fixes: af75078fece3 ("first public release") Signed-off-by: Daniel Mrzyglod --- examples/exception_path/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index bec980403c..e5eedcc163 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -350,8 +350,7 @@ setup_port_lcore_affinities(void) } port_ids[i] = rx_port++; - } - else if (output_cores_mask & (1ULL << i)) { + } else if (output_cores_mask & (1ULL << (i & 0x3f))) { /* Skip ports that are not enabled */ while ((ports_mask & (1 << tx_port)) == 0) { tx_port++; -- 2.20.1