We want to store a non-negative int here. The original code had a check
for unsigned long less than zero which is a mistake but also casting
from a positive long to an int can result in a negative number.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct ptlrpc_service *svc = container_of(kobj, struct ptlrpc_service,
srv_kobj);
int rc;
- unsigned long val;
+ int val;
- rc = kstrtoul(buffer, 10, &val);
+ rc = kstrtoint(buffer, 10, &val);
if (rc < 0)
return rc;