]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
libxg: drop dead assignment to "rc" from xc_cpuid_apply_policy()
authorJan Beulich <jbeulich@suse.com>
Wed, 14 Jun 2023 10:31:54 +0000 (12:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 14 Jun 2023 10:31:54 +0000 (12:31 +0200)
"rc" is written immediately below the outer if(). Fold the remaining two
if()s.

Coverity ID: 1532320
Fixes: 685e922d6f30 ("tools/libxc: Rework xc_cpuid_apply_policy() to use {get,set}_cpu_policy()")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
tools/libs/guest/xg_cpuid_x86.c

index 57221ffea8ce117dc8aa7b90b48d764f90e18050..5b035223f4f557874eda00844cd8ca7f5f97ffae 100644 (file)
@@ -462,17 +462,12 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     /* Get the host policy. */
     rc = xc_get_cpu_featureset(xch, XEN_SYSCTL_cpu_featureset_host,
                                &len, host_featureset);
-    if ( rc )
+    /* Tolerate "buffer too small", as we've got the bits we need. */
+    if ( rc && errno != ENOBUFS )
     {
-        /* Tolerate "buffer too small", as we've got the bits we need. */
-        if ( errno == ENOBUFS )
-            rc = 0;
-        else
-        {
-            PERROR("Failed to obtain host featureset");
-            rc = -errno;
-            goto out;
-        }
+        PERROR("Failed to obtain host featureset");
+        rc = -errno;
+        goto out;
     }
 
     /* Get the domain's default policy. */