Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1613901

[PATCH 1/2] xen: correct error handling in xen-acpi-processor

From Juergen Gross <jgross@suse.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] xen: correct error handling in xen-acpi-processor
Date 2017-03-31 13:30 +0200
Message-ID <tr2UH-3Xe-47@gated-at.bofh.it> (permalink)
References <tr2UG-3Xe-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Error handling in upload_pm_data() is rather questionable: possible
errno values from called functions are or'ed together resulting in
strange return values: -EINVAL and -ENOMEM would e.g. result in
returning -EXDEV.

Fix this by bailing out early after the first error.

Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/xen/xen-acpi-processor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index 23e391d..3659ed3 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -283,8 +283,8 @@ static int upload_pm_data(struct acpi_processor *_pr)
 	if (_pr->flags.power)
 		err = push_cxx_to_hypervisor(_pr);
 
-	if (_pr->performance && _pr->performance->states)
-		err |= push_pxx_to_hypervisor(_pr);
+	if (!err && _pr->performance && _pr->performance->states)
+		err = push_pxx_to_hypervisor(_pr);
 
 	mutex_unlock(&acpi_ids_mutex);
 	return err;
-- 
2.10.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] xen: fix and cleanup of xen-acpi-processor Juergen Gross <jgross@suse.com> - 2017-03-31 13:30 +0200
  [PATCH 1/2] xen: correct error handling in xen-acpi-processor Juergen Gross <jgross@suse.com> - 2017-03-31 13:30 +0200
    Re: [PATCH 1/2] xen: correct error handling in xen-acpi-processor Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-03-31 16:20 +0200
      Re: [PATCH 1/2] xen: correct error handling in xen-acpi-processor Juergen Gross <jgross@suse.com> - 2017-03-31 16:20 +0200
  [PATCH 2/2] xen: make functions in xen-acpi-processor return void Juergen Gross <jgross@suse.com> - 2017-03-31 13:30 +0200
    Re: [PATCH 2/2] xen: make functions in xen-acpi-processor return void Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-03-31 16:20 +0200

csiph-web