From: Christophe Jaillet Date: Mon, 20 Apr 2015 08:26:52 +0000 (+0200) Subject: s390/3215: free memory in error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a7c501e6759db49d9dffb10ed62142d705e3f90;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git s390/3215: free memory in error path If one memory allocation fails, there is a memory leak. Signed-off-by: Christophe Jaillet Signed-off-by: Martin Schwidefsky --- 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; }