Skip to content

Commit

Permalink
net: sxgbe: fix return value of __setup handler
Browse files Browse the repository at this point in the history
__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: acc18c1 ("net: sxgbe: add EEE(Energy Efficient Ethernet) for Samsung sxgbe")
Fixes: 1edb9ca ("net: sxgbe: add basic framework for Samsung 10Gb ethernet driver")
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: Siva Reddy <siva.kallam@samsung.com>
Cc: Girish K S <ks.giri@samsung.com>
Cc: Byungho An <bh74.an@samsung.com>
Link: https://lore.kernel.org/r/20220224033528.24640-1-rdunlap@infradead.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Randy Dunlap authored and Jakub Kicinski committed Feb 25, 2022
1 parent b3a34dc commit 50e06dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2285,18 +2285,18 @@ static int __init sxgbe_cmdline_opt(char *str)
char *opt;

if (!str || !*str)
return -EINVAL;
return 1;
while ((opt = strsep(&str, ",")) != NULL) {
if (!strncmp(opt, "eee_timer:", 10)) {
if (kstrtoint(opt + 10, 0, &eee_timer))
goto err;
}
}
return 0;
return 1;

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

__setup("sxgbeeth=", sxgbe_cmdline_opt);
Expand Down

0 comments on commit 50e06dd

Please sign in to comment.