]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: Convert unreachable() to BUG()
authorTiezhu Yang <yangtiezhu@loongson.cn>
Sat, 8 Mar 2025 05:50:45 +0000 (13:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:01:50 +0000 (13:01 +0100)
commit55eed991c5e4e4c7fd2976b61b100b27a526720e
tree8d76c625c003c5a641fd492339ce6849ce0ed5c4
parentc10081d6648b49ec16756f82030d1bf296e30a33
LoongArch: Convert unreachable() to BUG()

commit da64a2359092ceec4f9dea5b329d0aef20104217 upstream.

When compiling on LoongArch, there exists the following objtool warning
in arch/loongarch/kernel/machine_kexec.o:

  kexec_reboot() falls through to next function crash_shutdown_secondary()

Avoid using unreachable() as it can (and will in the absence of UBSAN)
generate fall-through code. Use BUG() so we get a "break BRK_BUG" trap
(with unreachable annotation).

Cc: stable@vger.kernel.org # 6.12+
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/kernel/machine_kexec.c