Skip to content

Commit e01b042

Browse files
rddunlapkuba-moo
authored andcommitted
net: stmmac: fix return value of __setup handler
__setup() handlers should return 1 on success, i.e., the parameter has been handled. A return of 0 causes the "option=value" string to be added to init's environment strings, polluting it. Fixes: 47dd7a5 ("net: add support for STMicroelectronics Ethernet controllers.") Fixes: f3240e2 ("stmmac: remove warning when compile as built-in (V2)") Signed-off-by: Randy Dunlap <[email protected]> Reported-by: Igor Zhbanov <[email protected]> Link: lore.kernel.org/r/[email protected] Cc: Giuseppe Cavallaro <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: Jose Abreu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 50e06dd commit e01b042

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7491,7 +7491,7 @@ static int __init stmmac_cmdline_opt(char *str)
74917491
char *opt;
74927492

74937493
if (!str || !*str)
7494-
return -EINVAL;
7494+
return 1;
74957495
while ((opt = strsep(&str, ",")) != NULL) {
74967496
if (!strncmp(opt, "debug:", 6)) {
74977497
if (kstrtoint(opt + 6, 0, &debug))
@@ -7522,11 +7522,11 @@ static int __init stmmac_cmdline_opt(char *str)
75227522
goto err;
75237523
}
75247524
}
7525-
return 0;
7525+
return 1;
75267526

75277527
err:
75287528
pr_err("%s: ERROR broken module parameter conversion", __func__);
7529-
return -EINVAL;
7529+
return 1;
75307530
}
75317531

75327532
__setup("stmmaceth=", stmmac_cmdline_opt);

0 commit comments

Comments
 (0)