summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-07-11 09:17:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-17 14:42:32 +0200
commitca631f184f7878317a76c2b1426cb7003dfa4c9f (patch)
treeb925eb457857ee8f955364ee45e8d22712b9e176
parentf8b4a29481582bea75d57c1742a5200dbd27e8ef (diff)
downloadlinux-stable-ca631f184f7878317a76c2b1426cb7003dfa4c9f.tar.gz
linux-stable-ca631f184f7878317a76c2b1426cb7003dfa4c9f.zip
tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH
[ Upstream commit bed4593645366ad7362a3aa7bc0d100d8d8236a8 ] If DEBUG_SECTION_MISMATCH enabled, __calc_tpm2_event_size() will not be inlined, this cause section mismatch like this: WARNING: modpost: vmlinux.o(.text.unlikely+0xe30c): Section mismatch in reference from the variable L0 to the function .init.text:early_ioremap() The function L0() references the function __init early_memremap(). This is often because L0 lacks a __init annotation or the annotation of early_ioremap is wrong. Fix it by using __always_inline instead of inline for the called-once function __calc_tpm2_event_size(). Fixes: 44038bc514a2 ("tpm: Abstract crypto agile event size calculations") Cc: stable@vger.kernel.org # v5.3 Reported-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--include/linux/tpm_eventlog.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h
index 739ba9a03ec1..20c0ff54b7a0 100644
--- a/include/linux/tpm_eventlog.h
+++ b/include/linux/tpm_eventlog.h
@@ -157,7 +157,7 @@ struct tcg_algorithm_info {
* Return: size of the event on success, 0 on failure
*/
-static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
+static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
struct tcg_pcr_event *event_header,
bool do_mapping)
{