[patch] vfio/type1: fix a leak on error path

2013-06-27 Thread Dan Carpenter
If vfio_unmap_unpin() returns an error then we leak split. I've moved the allocation later in the function to fix this. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 98231d1..657f6a8 100644 ---

Re: [patch] vfio/type1: fix a leak on error path

2013-06-27 Thread Alex Williamson
On Thu, 2013-06-27 at 10:07 +0300, Dan Carpenter wrote: If vfio_unmap_unpin() returns an error then we leak split. I've moved the allocation later in the function to fix this. Thanks for spotting this and for the patch. The allocation is done early because if we get an allocation failure