diff options
author | Christian Borntraeger <cborntra@de.ibm.com> | 2005-11-07 09:59:12 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 16:53:34 +0100 |
commit | a5da866fe0272db6b664d4c790ad98320bf2feb6 (patch) | |
tree | cdb6baee87de4f2ff8034c6fbdb0aa9da02b0ab6 /drivers/s390 | |
parent | [PATCH] s390: const pointer uaccess (diff) | |
download | linux-a5da866fe0272db6b664d4c790ad98320bf2feb6.tar.xz linux-a5da866fe0272db6b664d4c790ad98320bf2feb6.zip |
[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>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/char/vmcp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index 8990d8076e7d..19762f3476aa 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c @@ -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, |