Skip to content

Commit 602ba77

Browse files
liu-song-6akpm00
authored andcommitted
watchdog: handle comma separated nmi_watchdog command line
Per the document, the kernel can accept comma separated command line like nmi_watchdog=nopanic,0. However, the code doesn't really handle it. Fix the kernel to handle it properly. Link: https://lkml.kernel.org/r/20240430060236.1878002-1-song@kernel.org Signed-off-by: Song Liu <song@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 91d743a commit 602ba77

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/watchdog.c

+7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void __init hardlockup_detector_disable(void)
7171

7272
static int __init hardlockup_panic_setup(char *str)
7373
{
74+
next:
7475
if (!strncmp(str, "panic", 5))
7576
hardlockup_panic = 1;
7677
else if (!strncmp(str, "nopanic", 7))
@@ -79,6 +80,12 @@ static int __init hardlockup_panic_setup(char *str)
7980
watchdog_hardlockup_user_enabled = 0;
8081
else if (!strncmp(str, "1", 1))
8182
watchdog_hardlockup_user_enabled = 1;
83+
while (*(str++)) {
84+
if (*str == ',') {
85+
str++;
86+
goto next;
87+
}
88+
}
8289
return 1;
8390
}
8491
__setup("nmi_watchdog=", hardlockup_panic_setup);

0 commit comments

Comments
 (0)