aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/ccwgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/ccwgroup.c')
-rw-r--r--drivers/s390/cio/ccwgroup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index fe1ad1722158..85b2e51a42ae 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -318,7 +318,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
318{ 318{
319 struct ccwgroup_device *gdev; 319 struct ccwgroup_device *gdev;
320 struct ccwgroup_driver *gdrv; 320 struct ccwgroup_driver *gdrv;
321 unsigned int value; 321 unsigned long value;
322 int ret; 322 int ret;
323 323
324 gdev = to_ccwgroupdev(dev); 324 gdev = to_ccwgroupdev(dev);
@@ -329,7 +329,9 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
329 if (!try_module_get(gdrv->owner)) 329 if (!try_module_get(gdrv->owner))
330 return -EINVAL; 330 return -EINVAL;
331 331
332 value = simple_strtoul(buf, NULL, 0); 332 ret = strict_strtoul(buf, 0, &value);
333 if (ret)
334 goto out;
333 ret = count; 335 ret = count;
334 if (value == 1) 336 if (value == 1)
335 ccwgroup_set_online(gdev); 337 ccwgroup_set_online(gdev);
@@ -337,6 +339,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
337 ccwgroup_set_offline(gdev); 339 ccwgroup_set_offline(gdev);
338 else 340 else
339 ret = -EINVAL; 341 ret = -EINVAL;
342out:
340 module_put(gdrv->owner); 343 module_put(gdrv->owner);
341 return ret; 344 return ret;
342} 345}