Re: [PATCH 3/3] libxl: remove unneeded cleanup_unlock label

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04.03.2015 01:09, Jim Fehlig wrote:
> In the old days of a global driver lock, it was necessary to unlock
> the driver after a domain restore operation.  When the global lock
> was removed from the driver, some remnants were left behind in
> libxlDomainRestoreFlags.  Remove this unneeded (and incorrect) code.
> 
> Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
> ---
>  src/libxl/libxl_driver.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index ce3a99b..55fa64f 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -1464,17 +1464,17 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
>  
>      fd = libxlDomainSaveImageOpen(driver, cfg, from, &def, &hdr);
>      if (fd < 0)
> -        goto cleanup_unlock;
> +        return -1;

While this one is okay, ...

>  
>      if (virDomainRestoreFlagsEnsureACL(conn, def) < 0)
> -        goto cleanup_unlock;
> +        return -1;

.. this one's not. If EnsureACL fails, the @fd opened just above is
leaked. ACKed with s/return -1/goto cleanup/.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]