From: Thomas Sujith <[EMAIL PROTECTED]>

Need to check whether thermal_cooling_device_register
returned ERROR or not.

Signed-off-by: Thomas Sujith <[EMAIL PROTECTED]>
Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/video.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 7f714fa..12cce69 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",
-- 
1.5.4.2

-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to