Skip to content

Commit 96c9e80

Browse files
rddunlapgregkh
authored andcommitted
kgdbts: fix return value of __setup handler
__setup() handlers should return 1 to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) environment strings. So return 1 from kgdbts_option_setup(). Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts=", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts= Link: lore.kernel.org/r/[email protected] Fixes: e8d31c2 ("kgdb: add kgdb internal test suite") Cc: [email protected] Cc: Jason Wessel <[email protected]> Cc: Daniel Thompson <[email protected]> Cc: Douglas Anderson <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Reported-by: Igor Zhbanov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 202c089 commit 96c9e80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/kgdbts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,10 +1070,10 @@ static int kgdbts_option_setup(char *opt)
10701070
{
10711071
if (strlen(opt) >= MAX_CONFIG_LEN) {
10721072
printk(KERN_ERR "kgdbts: config string too long\n");
1073-
return -ENOSPC;
1073+
return 1;
10741074
}
10751075
strcpy(config, opt);
1076-
return 0;
1076+
return 1;
10771077
}
10781078

10791079
__setup("kgdbts=", kgdbts_option_setup);

0 commit comments

Comments
 (0)