Signed-off-by: Markus Theil <[email protected]>
---
lib/eal/common/eal_common_lcore.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/eal/common/eal_common_lcore.c
b/lib/eal/common/eal_common_lcore.c
index 48c333cff1..94625c2ebc 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -111,6 +111,9 @@ unsigned int rte_get_next_lcore(unsigned int i, int
skip_main, int wrap)
unsigned int
rte_lcore_to_socket_id(unsigned int lcore_id)
{
+ if (unlikely(lcore_id >= RTE_MAX_LCORE))
+ return -1;
+
return lcore_config[lcore_id].socket_id;
}
--
2.38.0