From 43ff39f2f6450fa2e9a566f8bf007a26d76f2c9d Mon Sep 17 00:00:00 2001 From: Thomas Sujith Date: Fri, 15 Feb 2008 18:29:18 -0500 Subject: [PATCH] ACPI video: check for error from thermal_cooling_device_register Need to check whether thermal_cooling_device_register returned ERROR or not. Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- drivers/acpi/video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 7f714fa2a454..12cce69b5441 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -731,6 +731,9 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) device->cdev = thermal_cooling_device_register("LCD", device->dev, &video_cooling_ops); + if (IS_ERR(device->cdev)) + return; + if (device->cdev) { printk(KERN_INFO PREFIX "%s is registered as cooling_device%d\n", -- GitLab