All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] ACPI: fix return value of XEN_PM_PDC platform op
Date: Wed, 28 Nov 2012 08:28:44 +0000	[thread overview]
Message-ID: <CCDB7BBC.4627C%keir.xen@gmail.com> (raw)
In-Reply-To: <50B5CEE902000078000ABF9D@nat28.tlf.novell.com>

On 28/11/2012 07:44, "Jan Beulich" <JBeulich@suse.com> wrote:

> Should return -EFAULT when copying to guest memory fails.
> 
> Once touching this code, also switch to using the more relaxed copy
> function (copying from the same guest memory already validated the
> virtual address range).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
>                      ACPI_PDC_SMP_C1PT) & ~mask;
>          ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
>      }
> -    if ( !ret )
> -        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
> +    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
> +        ret = -EFAULT;
>  
>      return ret;
>  }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

      reply	other threads:[~2012-11-28  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28  7:44 [PATCH] ACPI: fix return value of XEN_PM_PDC platform op Jan Beulich
2012-11-28  8:28 ` Keir Fraser [this message]

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=CCDB7BBC.4627C%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.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.