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

[PATCH 4/5] libxg: drop dead assignment to "rc" from xc_cpuid_apply_policy()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 12 Jun 2023 13:47:13 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B+/y/m3EuaFu5IzJQsr10ANAsj4GrJLsTnjbxyCCt7g=; b=KhQDCSOp4CWzl7HCJ1xAJ7Faru+4+vUploMMs7So2jQfup+2Ws+FkPHs0UmwWOUURZ7YVDZHb9WM9HU45o3v1D+qmT0WrPjP7T5uxkSxlA0SwX+K2t/uJzTpA9tPDqTobxF0yyiMQJF3Z98MvzsjAsjqs+mi3AHtWtizCRei77s21folNqu7EeMo265BqSuneZICW+NNZbgG255LRnyRDJ+evEC83WP5nUhu79OngS3mRxgCVSAymnYyTB5XJJZhunhvJC/mEJhtK1MKmYCNUMI/TyQT4tK1I42s1IYCwP0gDoTYE8u+249voX0ssif6P3nNWcL8ifJhfPQBqiDnhw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jroH4RQ06pKYUqUL/tSj0ZPW84WaSBvwaZOwhLDIX+igvk91SuhBMRIreM9Ul5yZ5xLMfXxlOqHL4xlMR4x7QX0xq+KXKj/vjpovO+Izvvkxm7mcMvUm7vX5a6dewThZQPUYSdTxDJMvmwzzldrYVXUcGDyz1d2wvmrhaqyoSocr0nr4Q6xMoc8At4vWfnP65KJnroDAasMANJP/KbIB1RSoS6OjotDMO/oKN3gGmSXgnXQXEcIqdf7f5nKeat6aJ1lty6T/FPXq6CaQuCXHfGsi+Pmk2VR/Ax49NbX3z7HF9ufbmDEaXn9wWk+kSVcxd4XFAf0PkwoKkmAZ79Dkgg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 12 Jun 2023 11:47:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

"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@xxxxxxxx>
---
The code in question was subsequently moved by 54463aa79dac ("x86/hvm:
Disable MPX by default").

--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -462,17 +462,12 @@ int xc_cpuid_apply_policy(xc_interface *
     /* 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. */




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.