mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Hanjun Guo <hanjun.guo@linaro.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@linaro.org, linaro-kernel@lists.linaro.org
Subject: Re: [PATCH] ACPI: Fix potential NULL pointer dereference in acpi_processor_add()
Date: Wed, 29 May 2013 01:30:24 +0200	[thread overview]
Message-ID: <1693841.iH9OWSxHyo@vostro.rjw.lan> (raw)
In-Reply-To: <519E0F2A.4070602@linaro.org>

On Thursday, May 23, 2013 08:44:26 PM Hanjun Guo wrote:
> In acpi_processor_add(), get_cpu_device() will return NULL sometimes,
> although the chances are small, I think it should be fixed.
> 
> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>

This patch isn't necessary any more after the changes queued up for 3.11
in the acpi-hotplug branch of the linux-pm.git tree.

Thanks,
Rafael


> ---
>  drivers/acpi/processor_driver.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> index bec717f..dd64f23 100644
> --- a/drivers/acpi/processor_driver.c
> +++ b/drivers/acpi/processor_driver.c
> @@ -579,6 +579,10 @@ static int __cpuinit acpi_processor_add(struct acpi_device
> *device)
>         per_cpu(processors, pr->id) = pr;
> 
>         dev = get_cpu_device(pr->id);
> +       if (!dev) {
> +               result = -ENODEV;
> +               goto err_clear_processor;
> +       }
>         if (sysfs_create_link(&device->dev.kobj, &dev->kobj, "sysdev")) {
>                 result = -EFAULT;
>                 goto err_clear_processor;
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2013-05-28 23:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 12:44 Hanjun Guo
2013-05-28 23:30 ` Rafael J. Wysocki [this message]
2013-05-29  1:38   ` Hanjun Guo
2013-05-29 11:07     ` Martin Mokrejs
2013-05-30  2:29       ` Hanjun Guo
2013-05-30 13:57         ` Rafael J. Wysocki
2013-05-30 22:25           ` Greg Kroah-Hartman
2013-05-31  3:58             ` Hanjun Guo
2013-05-31 12:08               ` Rafael J. Wysocki

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=1693841.iH9OWSxHyo@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=hanjun.guo@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®