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

Commit a5da866f authored by Christian Borntraeger's avatar Christian Borntraeger Committed by Linus Torvalds
Browse files

[PATCH] s390: fix memory leak in vmcp



If vmcp is interrupted by a signal the vmcp command buffer is not freed.
Found by Pete Zaitcev.

Signed-off-by: default avatarChristian Borntraeger <cborntra@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1047aa77
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -103,8 +103,10 @@ vmcp_write(struct file *file, const char __user * buff, size_t count,
	}
	cmd[count] = '\0';
	session = (struct vmcp_session *)file->private_data;
	if (down_interruptible(&session->mutex))
	if (down_interruptible(&session->mutex)) {
		kfree(cmd);
		return -ERESTARTSYS;
	}
	if (!session->response)
		session->response = (char *)__get_free_pages(GFP_KERNEL
						| __GFP_REPEAT 	| GFP_DMA,