dect
/
linux-2.6
Archived
13
0
Fork 0

[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:
Christian Borntraeger 2005-11-07 00:59:12 -08:00 committed by Linus Torvalds
parent 1047aa7723
commit a5da866fe0
1 changed files with 3 additions and 1 deletions

View File

@ -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,