]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: Resolve Coverity warnings
authorJohn Ferlan <jferlan@redhat.com>
Wed, 11 Jun 2014 13:31:19 +0000 (09:31 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 11 Jun 2014 18:58:20 +0000 (14:58 -0400)
Resolve two Coverity issues introduced by commit id '9b8d6e1e'

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/libxl/libxl_migration.c

index 9fe904ef001139431bc71f47758115095337b304..a25edf0baabf0747ebc2a739f7214b9405bc4897 100644 (file)
@@ -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;
 }