Commit 9ebafb53 authored by Shivani Bhardwaj's avatar Shivani Bhardwaj Committed by Greg Kroah-Hartman

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: default avatarShivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae127bf3
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment