Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a7c501e authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Martin Schwidefsky
Browse files

s390/3215: free memory in error path



If one memory allocation fails, there is a memory leak.

Signed-off-by: default avatarChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 0b46e0a3
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -667,6 +667,8 @@ static struct raw3215_info *raw3215_alloc_info(void)
	info->buffer = kzalloc(RAW3215_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);
	info->buffer = kzalloc(RAW3215_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);
	info->inbuf = kzalloc(RAW3215_INBUF_SIZE, GFP_KERNEL | GFP_DMA);
	info->inbuf = kzalloc(RAW3215_INBUF_SIZE, GFP_KERNEL | GFP_DMA);
	if (!info->buffer || !info->inbuf) {
	if (!info->buffer || !info->inbuf) {
		kfree(info->inbuf);
		kfree(info->buffer);
		kfree(info);
		kfree(info);
		return NULL;
		return NULL;
	}
	}