Skip to content

Commit fe513c2

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
static_call: Replace pointless WARN_ON() in static_call_module_notify()
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: 9183c3f ("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
1 parent 4b30051 commit fe513c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/static_call_inline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static int static_call_module_notify(struct notifier_block *nb,
453453
case MODULE_STATE_COMING:
454454
ret = static_call_add_module(mod);
455455
if (ret) {
456-
WARN(1, "Failed to allocate memory for static calls");
456+
pr_warn("Failed to allocate memory for static calls\n");
457457
static_call_del_module(mod);
458458
}
459459
break;

0 commit comments

Comments
 (0)