From 2f972202315cf71fd60e890ebbed7d5bcf620ba4 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Wed, 30 Apr 2008 13:38:33 +0200 Subject: [S390] cio: Use strict_strtoul() for attributes. Make parsing of attribute writes handle incorrect input better. Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/qdio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/s390/cio/qdio.c') diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 43876e28737..445cf364e46 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -3663,11 +3663,11 @@ qdio_performance_stats_show(struct bus_type *bus, char *buf) static ssize_t qdio_performance_stats_store(struct bus_type *bus, const char *buf, size_t count) { - char *tmp; - int i; + unsigned long i; + int ret; - i = simple_strtoul(buf, &tmp, 16); - if ((i == 0) || (i == 1)) { + ret = strict_strtoul(buf, 16, &i); + if (!ret && ((i == 0) || (i == 1))) { if (i == qdio_performance_stats) return count; qdio_performance_stats = i; -- cgit v1.2.3-70-g09d2