mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
Staging: lustre: lproc_osc: Change the variable to be checked
The variable rc is supposed to hold the value returned by function kstrtoul which can either be 0, -EINVAL (-22) or -ERANGE (-34). Therefore, the check must be performed on rc instead of val for error values. Also, rc can never be greater than 0. Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
673536c988
commit
fea6fc647b
1 changed files with 1 additions and 3 deletions
|
|
@ -61,9 +61,7 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
|
|||
unsigned long val;
|
||||
|
||||
rc = kstrtoul(buffer, 10, &val);
|
||||
if (rc)
|
||||
return rc;
|
||||
if (val < 0 || val > 1)
|
||||
if (rc < 0)
|
||||
return -ERANGE;
|
||||
|
||||
/* opposite senses */
|
||||
|
|
|
|||
Loading…
Reference in a new issue