From bd057ae47d221cb92ebe370f81d01d470c0325df Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Tue, 6 Apr 2021 15:22:02 +0200 Subject: [PATCH] log: choose EAL log type on registration failure In the unlikely case where something goes wrong while registering a log type, the fallback is to use the EAL log type. Signed-off-by: Thomas Monjalon Reviewed-by: David Marchand Reviewed-by: Andrew Rybchenko --- lib/librte_eal/include/rte_log.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h index 173004fd71..21a7d16340 100644 --- a/lib/librte_eal/include/rte_log.h +++ b/lib/librte_eal/include/rte_log.h @@ -380,6 +380,8 @@ RTE_INIT(__##type) \ { \ type = rte_log_register_type_and_pick_level(RTE_STR(name), \ RTE_LOG_##level); \ + if (type < 0) \ + type = RTE_LOGTYPE_EAL; \ } #ifdef __cplusplus -- 2.20.1