Explorar o código

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 <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Thomas Sujith %!s(int64=17) %!d(string=hai) anos
pai
achega
43ff39f2f6
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      drivers/acpi/video.c

+ 3 - 0
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->cdev = thermal_cooling_device_register("LCD",
 					device->dev, &video_cooling_ops);
 					device->dev, &video_cooling_ops);
+		if (IS_ERR(device->cdev))
+			return;
+
 		if (device->cdev) {
 		if (device->cdev) {
 			printk(KERN_INFO PREFIX
 			printk(KERN_INFO PREFIX
 				"%s is registered as cooling_device%d\n",
 				"%s is registered as cooling_device%d\n",