diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2008-04-30 13:38:33 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-04-30 13:38:43 +0200 |
commit | 2f972202315cf71fd60e890ebbed7d5bcf620ba4 (patch) | |
tree | 80e43d5bacb7b85417168bc257369d3642cc196c /drivers/s390/cio/ccwgroup.c | |
parent | 0ff5ce7f30b45cc2014cec465c0e96c16877116e (diff) | |
download | lwn-2f972202315cf71fd60e890ebbed7d5bcf620ba4.tar.gz lwn-2f972202315cf71fd60e890ebbed7d5bcf620ba4.zip |
[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 { struct ccwgroup_device *gdev; struct ccwgroup_driver *gdrv; - unsigned int value; + unsigned long value; int ret; gdev = to_ccwgroupdev(dev); @@ -329,7 +329,9 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const if (!try_module_get(gdrv->owner)) return -EINVAL; - value = simple_strtoul(buf, NULL, 0); + ret = strict_strtoul(buf, 0, &value); + if (ret) + goto out; ret = count; if (value == 1) ccwgroup_set_online(gdev); @@ -337,6 +339,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const ccwgroup_set_offline(gdev); else ret = -EINVAL; +out: module_put(gdrv->owner); return ret; } |