Commit a5da866f authored by Christian Borntraeger's avatar Christian Borntraeger Committed by Linus Torvalds

[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: default avatarChristian Borntraeger <cborntra@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1047aa77
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment