[patch 14/14] s390: fix memory leak in vmcp.

From: Martin Schwidefsky
Date: Fri Oct 28 2005 - 09:11:54 EST


From: Christian Borntraeger <cborntra@xxxxxxxxxx>

[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@xxxxxxxxxx>
Signed-off-by: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
---

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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/