]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
static_call: Replace pointless WARN_ON() in static_call_module_notify()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 4 Sep 2024 09:08:28 +0000 (11:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:19 +0000 (15:11 +0200)
commitbc9356513d56b688775497b7ac6f2b967f46a80c
tree5be2c42b3b13905ec606279e565ad47507003e1d
parented4c8ce0f307f2ab8778aeb40a8866d171e8f128
static_call: Replace pointless WARN_ON() in static_call_module_notify()

[ Upstream commit fe513c2ef0a172a58f158e2e70465c4317f0a9a2 ]

static_call_module_notify() triggers a WARN_ON(), when memory allocation
fails in __static_call_add_module().

That's not really justified, because the failure case must be correctly
handled by the well known call chain and the error code is passed
through to the initiating userspace application.

A memory allocation fail is not a fatal problem, but the WARN_ON() takes
the machine out when panic_on_warn is set.

Replace it with a pr_warn().

Fixes: 9183c3f9ed71 ("static_call: Add inline static call infrastructure")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/8734mf7pmb.ffs@tglx
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/static_call_inline.c