Skip to content

Commit

Permalink
net: stmmac: fix return value of __setup handler
Browse files Browse the repository at this point in the history
commit e01b042 upstream.

__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 <rdunlap@infradead.org>
Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Link: https://lore.kernel.org/r/20220224033536.25056-1-rdunlap@infradead.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
rddunlap authored and gregkh committed Mar 8, 2022
1 parent 828f75c commit b85dd0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Expand Up @@ -7336,7 +7336,7 @@ static int __init stmmac_cmdline_opt(char *str)
char *opt;

if (!str || !*str)
return -EINVAL;
return 1;
while ((opt = strsep(&str, ",")) != NULL) {
if (!strncmp(opt, "debug:", 6)) {
if (kstrtoint(opt + 6, 0, &debug))
Expand Down Expand Up @@ -7367,11 +7367,11 @@ static int __init stmmac_cmdline_opt(char *str)
goto err;
}
}
return 0;
return 1;

err:
pr_err("%s: ERROR broken module parameter conversion", __func__);
return -EINVAL;
return 1;
}

__setup("stmmaceth=", stmmac_cmdline_opt);
Expand Down

0 comments on commit b85dd0d

Please sign in to comment.