summaryrefslogtreecommitdiff
path: root/drivers/s390/block/dasd_proc.c
diff options
context:
space:
mode:
authorStefan Weinhuber <wein@de.ibm.com>2011-08-03 16:44:20 +0200
committerHeiko Carstens <heiko.carstens@de.ibm.com>2011-08-03 16:44:19 +0200
commite4258d55bff06780cd424c671b576a90acc1592f (patch)
treea8a7da35bff7d9379678ba8f59f512f12681f768 /drivers/s390/block/dasd_proc.c
parent7dd6b3343fdc190712d1620ee8848d25c4c77c33 (diff)
[S390] dasd: use vmalloc for statistics input buffer
The size of the buffer that is used to store DASD statistics input strings depends on the user input. If the input string is to large, the write operation could fail with -ENOMEM. To avoid this, use vmalloc instead of kmalloc. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dasd_proc.c')
-rw-r--r--drivers/s390/block/dasd_proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 6c3c5364d082..e12989fff4ff 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -312,14 +312,14 @@ static ssize_t dasd_stats_proc_write(struct file *file,
pr_info("The statistics have been reset\n");
} else
goto out_parse_error;
- kfree(buffer);
+ vfree(buffer);
return user_len;
out_parse_error:
rc = -EINVAL;
pr_warning("%s is not a supported value for /proc/dasd/statistics\n",
str);
out_error:
- kfree(buffer);
+ vfree(buffer);
return rc;
#else
pr_warning("/proc/dasd/statistics: is not activated in this kernel\n");