[libvirt] [PATCH 3/3] libxl: Resolve Coverity warnings

Jim Fehlig jfehlig at suse.com
Wed Jun 11 15:08:47 UTC 2014


John Ferlan wrote:
> Resolve two Coverity issues introduced by commit id '9b8d6e1e'
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/libxl/libxl_migration.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
> index 9fe904e..a25edf0 100644
> --- a/src/libxl/libxl_migration.c
> +++ b/src/libxl/libxl_migration.c
> @@ -98,8 +98,7 @@ libxlDoMigrateReceive(virNetSocketPtr sock,
>      size_t i;
>      int ret;
>  
> -    virNetSocketAccept(sock, &client_sock);
> -    if (client_sock == NULL) {
> +    if (virNetSocketAccept(sock, &client_sock) < 0) {
>          virReportError(VIR_ERR_OPERATION_INVALID, "%s",
>                         _("Fail to accept migration connection"));
>          goto cleanup;
> @@ -526,8 +525,7 @@ libxlDomainMigrationFinish(virConnectPtr dconn,
>   cleanup:
>      if (event)
>          libxlDomainEventQueue(driver, event);
> -    if (vm)
> -        virObjectUnlock(vm);
> +    virObjectUnlock(vm);
>      virObjectUnref(cfg);
>      return dom;
>  }
>   

ACK.

Regards,
Jim




More information about the libvir-list mailing list