[PATCH] firmware_loader: don't WARN when usermodehelper is disabled
From: xujiahao
Date: Wed Nov 04 2026 - 03:39:04 EST
fw_load_from_user_helper() warns when usermodehelper_read_trylock()
fails. That call fails with -EAGAIN only when usermodehelper_disabled
is UMH_DISABLED, which is set by usermodehelper_disable() during system
shutdown: kernel_restart_prepare() and kernel_shutdown_prepare() both
call it right before device_shutdown().
A firmware request that races with system shutdown is an expected
error, not a kernel bug. The FW_OPT_NOWAIT branch a few lines above
handles the very same condition by returning -EBUSY without warning,
and the failure is already reported through dev_err(), so the WARN adds
nothing but an unusable stack trace.
Drop the WARN_ON() and keep returning the error.
Reported-by: syzbot+8f06445357a052a92657@xxxxxxxxxxxxxxxxxxxxxxxxx
Closes: https://syzkaller.appspot.com/bug?extid=8f06445357a052a92657
Signed-off-by: xujiahao <xujiahao@xxxxxxxxxxxxxxxxxxxx>
---
drivers/base/firmware_loader/fallback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/base/firmware_loader/fallback.c
index 00d6b6e..9bdcf9a 100644
--- a/drivers/base/firmware_loader/fallback.c
+++ b/drivers/base/firmware_loader/fallback.c
@@ -155,7 +155,7 @@ static int fw_load_from_user_helper(struct firmware *firmware,
}
} else {
ret = usermodehelper_read_trylock();
- if (WARN_ON(ret)) {
+ if (ret) {
dev_err(device, "firmware: %s will not be loaded\n",
name);
return ret;
--
2.43.0