From fcc541d2adcbb81aa9ba472dbc660170f89bbe58 Mon Sep 17 00:00:00 2001 From: Wang ShaoBo Date: Wed, 20 May 2020 16:17:48 +0800 Subject: [PATCH] livepatch/core: Fix compile error when CONFIG_JUMP_LABEL closed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hulk inclusion category: bugfix bugzilla: 28338/31814 CVE: NA ----------------------------------------------- CONFIG_JUMP_LABEL depends on CC_HAS_ASM_GOTO, some older compiler may not support. if CONFIG_JUMP_LABEL closed, compile error as follow: kernel/livepatch/core.c: In function ‘klp_init_object_loaded’: kernel/livepatch/core.c:1084:2: error: implicit declaration of function ‘jump_label_register’ [-Werror=implicit-function-declaration] ret = jump_label_register(patch->mod); ^ Fixes: 4a7e5316718c ("livepatch/core: support jump_label") Signed-off-by: Wang ShaoBo Reviewed-by: Cheng Jian Signed-off-by: Yang Yingliang --- include/linux/jump_label.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index c2d4a21cb911..802883634c95 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h @@ -240,6 +240,11 @@ static inline int jump_label_apply_nops(struct module *mod) return 0; } +static inline int jump_label_register(struct module *mod) +{ + return 0; +} + static inline void static_key_enable(struct static_key *key) { STATIC_KEY_CHECK_USE(key); -- GitLab