param: fix return value handling in param_set_*
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 26 May 2011 23:38:04 +0000 (19:38 -0400)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 30 May 2011 01:23:22 +0000 (11:23 +1000)
commitef08531700962a61e9f8441219fced5e22043200
treee3ac3959253245f729c61fbc7daffc946afc178f
parentacc62c0358771d6188a7c4965d1f434fed8e8b07
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