Re: [REPOST] [PATCH] acpi thermal fix result check

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

 



On Mon, 2008-04-07 at 23:55 +0200, Krzysztof Helt wrote:
> From: Krzysztof Helt <krzysztof.h1@xxxxx>
> 
> The  thermal_zone_device_register() uses ERR_PTR macro
> to return values. A correct check is to use the IS_ERR macro.
> 
> Signed-off-by: Krzysztof Helt <krzysztof.h1@xxxxx>
Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
> ---
> 
> This patch was done against 2.6.25-rc8.
> The 2.6.25 kernels panic on Compaq AP550 without this patch
> as it has more then 10 (THERMAL_MAX_TRIPS) trip points (there are 12).
> 
> diff -urp linux-2.6.24/drivers/acpi/thermal.c linux-2.6.25/drivers/acpi/thermal.c
> --- linux-2.6.24/drivers/acpi/thermal.c	2008-04-07 23:17:24.145477887 +0200
> +++ linux-2.6.25/drivers/acpi/thermal.c	2008-04-07 23:24:04.341336464 +0200
> @@ -1125,7 +1125,7 @@ static int acpi_thermal_register_thermal
>  			tz->trips.active[i].flags.valid; i++, trips++);
>  	tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone",
>  					trips, tz, &acpi_thermal_zone_ops);
> -	if (!tz->thermal_zone)
> +	if (IS_ERR(tz->thermal_zone))
>  		return -ENODEV;
>  
>  	result = sysfs_create_link(&tz->device->dev.kobj,
> --
> 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

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