[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>
This commit is contained in:
parent
1047aa7723
commit
a5da866fe0
|
@ -103,8 +103,10 @@ vmcp_write(struct file *file, const char __user * buff, size_t count,
|
||||||
}
|
}
|
||||||
cmd[count] = '\0';
|
cmd[count] = '\0';
|
||||||
session = (struct vmcp_session *)file->private_data;
|
session = (struct vmcp_session *)file->private_data;
|
||||||
if (down_interruptible(&session->mutex))
|
if (down_interruptible(&session->mutex)) {
|
||||||
|
kfree(cmd);
|
||||||
return -ERESTARTSYS;
|
return -ERESTARTSYS;
|
||||||
|
}
|
||||||
if (!session->response)
|
if (!session->response)
|
||||||
session->response = (char *)__get_free_pages(GFP_KERNEL
|
session->response = (char *)__get_free_pages(GFP_KERNEL
|
||||||
| __GFP_REPEAT | GFP_DMA,
|
| __GFP_REPEAT | GFP_DMA,
|
||||||
|
|
Reference in New Issue