Fix leak in blkback initialization
PATCH 1/1 Fix leak in blkback initialization
In case of failing due to lack of memory in the system, blkif_init potentially leaves a leak if some of the allocations was sucessfully suceeded.
This patch frees the memory allocated, avoiding the leak.
Signature · 1 line
glommer
# HG changeset patch
# User root@kct
# Node ID 0b7920d3ca98c3c011b2756afcffb7e2c31b7d2d # Parent 8f6d4878d02e65438dabda642d7bf84679dbd464
In case of failing due to lack of memory in the system, blkif_init potentially leaves a leak if some of the allocations was sucessfully suceeded.
This patch frees the memory allocated, avoiding the leak.
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c +3 -0
@@ -540,6 +540,9 @@ pending_vaddrs =kmalloc (sizeof (pending_vaddrs[0 ]) * mmap_pages,GFP_KERNEL );if (!pending_reqs || !pending_grant_handles || !pending_vaddrs) { +kfree (pending_reqs); +kfree (pending_grant_handles); +kfree (pending_vaddrs);printk ("%s: out of memory\n" , __FUNCTION__);return -1 ; }
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 5 lines · Glauber de Oliveira Costa
In case of failing due to lack of memory in the system,
blkif_initpotentially leaves a leak if some of the allocations was sucessfully suceeded.This patch frees the memory allocated, avoiding the leak.
This has already been corrected (changeset 8469)
Thanks,
Signature · 1 line
Vincent Hanquez
Yes, I saw that. It just happened to me to see the error a little bit before seeing the correction =]
Thanks,
glommer.
Quoted 9 lines · Vincent Hanquez
Quoted 5 lines · Glauber de Oliveira Costa
In case of failing due to lack of memory in the system,
blkif_initpotentially leaves a leak if some of the allocations was sucessfully suceeded.This patch frees the memory allocated, avoiding the leak.
This has already been corrected (changeset 8469)
Quoted 9 lines
Thanks,
--
Vincent Hanquez_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
--
Free Software : Technology for a better world
=============================
Glauber de Oliveira Costa
jabber: [email protected]
=============================