Messages in this thread Patch in this message | | | Date | Fri, 28 Oct 2005 16:11:45 +0200 | From | Martin Schwidefsky <> | Subject | [patch 14/14] s390: fix memory leak in vmcp. |
| |
From: Christian Borntraeger <cborntra@de.ibm.com>
[patch 14/14] 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> ---
drivers/s390/char/vmcp.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-)
diff -urpN linux-2.6/drivers/s390/char/vmcp.c linux-2.6-patched/drivers/s390/char/vmcp.c --- linux-2.6/drivers/s390/char/vmcp.c 2005-10-28 02:02:08.000000000 +0200 +++ linux-2.6-patched/drivers/s390/char/vmcp.c 2005-10-28 14:04:56.000000000 +0200 @@ -103,8 +103,10 @@ vmcp_write(struct file *file, const char } 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, - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |