]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Tue, 5 May 2015 10:53:24 +0000 (06:53 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 6 May 2015 00:02:37 +0000 (20:02 -0400)
Coverity points out it was possible to have a zero return from
qemuBuildRNGBackendProps thus not filling in 'props' and then
causing a NULL dereference on the next call.

src/qemu/qemu_command.c

index c32d8c61d362294bd77f1515b44e3837c520412c..68844fa973a292515d36404d4489ec7581b69338 100644 (file)
@@ -6464,7 +6464,9 @@ qemuBuildRNGBackendProps(virDomainRNGDefPtr rng,
         break;
 
     case VIR_DOMAIN_RNG_BACKEND_LAST:
-        break;
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("unknown rng-random backend"));
+        goto cleanup;
     }
 
     ret = 0;