All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Cc: konrad.wilk@oracle.com, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] xen: correct error handling in xen-acpi-processor
Date: Fri, 31 Mar 2017 10:10:50 -0400	[thread overview]
Message-ID: <56430503-ab15-4ff1-9432-f8c23e8981eb@oracle.com> (raw)
In-Reply-To: <20170331111948.17539-2-jgross@suse.com>

On 03/31/2017 07:19 AM, Juergen Gross wrote:
> 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.

And it doesn't matter anyway since noone checks return value. (not that
OR-ing errors makes much sense)

>
> Fix this by bailing out early after the first error.

I am not sure about this: why should we not try to load P states if C
states failed to load?

-boris

>
> 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;

  parent reply	other threads:[~2017-03-31 14:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 11:19 [PATCH 0/2] xen: fix and cleanup of xen-acpi-processor Juergen Gross
2017-03-31 11:19 ` [PATCH 1/2] xen: correct error handling in xen-acpi-processor Juergen Gross
2017-03-31 11:19 ` Juergen Gross
2017-03-31 14:10   ` Boris Ostrovsky
2017-03-31 14:10   ` Boris Ostrovsky [this message]
2017-03-31 14:19     ` Juergen Gross
2017-03-31 14:19     ` Juergen Gross
2017-03-31 11:19 ` [PATCH 2/2] xen: make functions in xen-acpi-processor return void Juergen Gross
2017-03-31 14:13   ` Boris Ostrovsky
2017-03-31 14:13     ` Boris Ostrovsky
2017-03-31 11:19 ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56430503-ab15-4ff1-9432-f8c23e8981eb@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.