DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] sched: fix integer handling issue
@ 2022-02-22 13:18 Megha Ajmera
  2022-02-22 14:13 ` Morten Brørup
  2022-02-23 17:36 ` [PATCH v2] sched: fix integer handling issue Megha Ajmera
  0 siblings, 2 replies; 13+ messages in thread
From: Megha Ajmera @ 2022-02-22 13:18 UTC (permalink / raw)
  To: dev, sham.singh.thakur, stephen, john.mcnamara

Masking of core mask was incorrect. Instead of using 1U for shifting, it
should be using 1LU as the result is assigned to uint64.

CID 375859: Potentially overflowing expression "1U << app_main_core" with
type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic,
and then used in a context that expects an expression of type "uint64_t"
(64 bits, unsigned).

Coverity issue: 375859

Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
---
 examples/qos_sched/args.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index 10ca7bea61..44f2f5640e 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -433,7 +433,7 @@ app_parse_args(int argc, char **argv)
 			return -1;
 		}
 	}
-	app_used_core_mask |= 1u << app_main_core;
+	app_used_core_mask |= 1lu << app_main_core;
 
 	if ((app_used_core_mask != app_eal_core_mask()) ||
 			(app_main_core != rte_get_main_lcore())) {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-02-24 22:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 13:18 [PATCH] sched: fix integer handling issue Megha Ajmera
2022-02-22 14:13 ` Morten Brørup
2022-02-22 16:03   ` Stephen Hemminger
2022-02-22 18:55     ` Ajmera, Megha
2022-02-23  7:17     ` Morten Brørup
2022-02-23 10:03       ` Ferruh Yigit
2022-02-23 10:42         ` more than 64 lcores not properly supported Morten Brørup
2022-02-23 11:20           ` Ferruh Yigit
2022-02-23 13:49             ` Thomas Monjalon
2022-02-23 15:12               ` Stephen Hemminger
2022-02-23 17:36 ` [PATCH v2] sched: fix integer handling issue Megha Ajmera
2022-02-23 18:13   ` Morten Brørup
2022-02-24 22:51     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).