All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: yongjun_wei@trendmicro.com.cn, linux-acpi@vger.kernel.org
Subject: Re: [PATCH] cpuidle / ACPI: fix potential NULL pointer dereference
Date: Mon, 08 Oct 2012 22:51:55 -0400	[thread overview]
Message-ID: <5073914B.3050606@kernel.org> (raw)
In-Reply-To: <CAPgLHd-8SzCJHbi8sknFvBe11taoXS5z3MOkM=Jet-VD5z14tw@mail.gmail.com>

Applied.

thanks,
Len Brown, Intel Open Source Technology Center

On 10/07/2012 08:40 PM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> The dereference should be moved below the NULL test.
> 
> dpatch engine is used to auto generate this patch.
> (https://github.com/weiyj/dpatch)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/acpi/processor_idle.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 3655ab9..e8086c7 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1132,7 +1132,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
>  int acpi_processor_hotplug(struct acpi_processor *pr)
>  {
>  	int ret = 0;
> -	struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id);
> +	struct cpuidle_device *dev;
>  
>  	if (disabled_by_idle_boot_param())
>  		return 0;
> @@ -1147,6 +1147,7 @@ int acpi_processor_hotplug(struct acpi_processor *pr)
>  	if (!pr->flags.power_setup_done)
>  		return -ENODEV;
>  
> +	dev = per_cpu(acpi_cpuidle_device, pr->id);
>  	cpuidle_pause_and_lock();
>  	cpuidle_disable_device(dev);
>  	acpi_processor_get_power_info(pr);
> 


      reply	other threads:[~2012-10-09  2:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08  0:40 [PATCH] cpuidle / ACPI: fix potential NULL pointer dereference Wei Yongjun
2012-10-09  2:51 ` Len Brown [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=5073914B.3050606@kernel.org \
    --to=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=weiyj.lk@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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.