Re: [PATCH] ACPI: Fix potential NULL pointer dereference in acpi_processor_add()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux