[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>
This commit is contained in:
Cornelia Huck
2008-04-30 13:38:33 +02:00
committed by Martin Schwidefsky
parent 0ff5ce7f30
commit 2f97220231
5 changed files with 35 additions and 18 deletions

View File

@@ -705,13 +705,17 @@ css_cm_enable_store(struct device *dev, struct device_attribute *attr,
{
struct channel_subsystem *css = to_css(dev);
int ret;
unsigned long val;
ret = strict_strtoul(buf, 16, &val);
if (ret)
return ret;
mutex_lock(&css->mutex);
switch (buf[0]) {
case '0':
switch (val) {
case 0:
ret = css->cm_enabled ? chsc_secm(css, 0) : 0;
break;
case '1':
case 1:
ret = css->cm_enabled ? 0 : chsc_secm(css, 1);
break;
default: