diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2008-04-30 07:38:33 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-04-30 07:38:43 -0400 |
commit | 2f972202315cf71fd60e890ebbed7d5bcf620ba4 (patch) | |
tree | 80e43d5bacb7b85417168bc257369d3642cc196c /drivers/s390/cio/ccwgroup.c | |
parent | 0ff5ce7f30b45cc2014cec465c0e96c16877116e (diff) |
[S390] cio: Use strict_strtoul() for attributes.
Make parsing of attribute writes handle incorrect input better.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/ccwgroup.c')
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 7 |
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; |
342 | out: | ||
340 | module_put(gdrv->owner); | 343 | module_put(gdrv->owner); |
341 | return ret; | 344 | return ret; |
342 | } | 345 | } |