summaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2015-04-20 10:26:52 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-04-23 16:55:50 +0200
commit0a7c501e6759db49d9dffb10ed62142d705e3f90 (patch)
tree49d3ba8ff316317ed7ba07d9d06f6950c136d0f8 /drivers/s390/char
parents390/kvm: remove delayed reallocation of page tables for KVM (diff)
downloadlinux-0a7c501e6759db49d9dffb10ed62142d705e3f90.tar.xz
linux-0a7c501e6759db49d9dffb10ed62142d705e3f90.zip
s390/3215: free memory in error path
If one memory allocation fails, there is a memory leak. Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/con3215.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index c43aca69fb30..0fc3fe5fd5b8 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -667,6 +667,8 @@ static struct raw3215_info *raw3215_alloc_info(void)
info->buffer = kzalloc(RAW3215_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);
info->inbuf = kzalloc(RAW3215_INBUF_SIZE, GFP_KERNEL | GFP_DMA);
if (!info->buffer || !info->inbuf) {
+ kfree(info->inbuf);
+ kfree(info->buffer);
kfree(info);
return NULL;
}