Staging: lustre: lproc_osc: Add check on a variable

Variable rc is not tested for negative values and hence a check should
be included. Also, a check for variable val should be introduced.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Shivani Bhardwaj 2015-10-18 18:50:30 +05:30 committed by Greg Kroah-Hartman
parent ae127bf301
commit 9ebafb530b

View File

@ -61,7 +61,9 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
unsigned long val;
rc = kstrtoul(buffer, 10, &val);
if (rc < 0)
if (rc)
return rc;
if (val > 1)
return -ERANGE;
/* opposite senses */