mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 01:34:00 +08:00
[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: Christian Borntraeger <cborntra@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
1047aa7723
commit
a5da866fe0
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user