]> Git Repo - linux.git/commitdiff
[PATCH] s390: fix memory leak in vmcp
authorChristian Borntraeger <[email protected]>
Mon, 7 Nov 2005 08:59:12 +0000 (00:59 -0800)
committerLinus Torvalds <[email protected]>
Mon, 7 Nov 2005 15:53:34 +0000 (07:53 -0800)
If vmcp is interrupted by a signal the vmcp command buffer is not freed.
Found by Pete Zaitcev.

Signed-off-by: Christian Borntraeger <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/s390/char/vmcp.c

index 8990d8076e7da0733d7c8bb0a8b32fa55908af2d..19762f3476aadd22289d4ddb4a44d82985465bf4 100644 (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,
This page took 0.053992 seconds and 4 git commands to generate.