]> git.baikalelectronics.ru Git - kernel.git/commit
param: fix return value handling in param_set_*
authorSatoru Moriya <satoru.moriya@hds.com>
Thu, 26 May 2011 23:38:04 +0000 (19:38 -0400)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 24 Jul 2011 12:36:03 +0000 (22:06 +0930)
commitc6d48f7b9cd6c8b994f7ebcb29efe892de051001
tree4e09dc38195e016c983f1aa9430ace78487cb178
parent6ebcce2cc8fbb1b89b3289bd0c09f8dff6badecd
param: fix return value handling in param_set_*

In STANDARD_PARAM_DEF, param_set_* handles the case in which strtolfn
returns -EINVAL but it may return -ERANGE. If it returns -ERANGE,
param_set_* may set uninitialized value to the paramerter. We should handle
both cases.

The one of the cases in which strtolfn() returns -ERANGE is following:

 *Type of module parameter is long
 *Set the parameter more than LONG_MAX

Signed-off-by: Satoru Moriya <satoru.moriya@hds.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
kernel/params.c