diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 2020907921cc..aab385188599 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -997,8 +997,18 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
997 | 997 | ||
998 | device->cdev = thermal_cooling_device_register("LCD", | 998 | device->cdev = thermal_cooling_device_register("LCD", |
999 | device->dev, &video_cooling_ops); | 999 | device->dev, &video_cooling_ops); |
1000 | if (IS_ERR(device->cdev)) | 1000 | if (IS_ERR(device->cdev)) { |
1001 | /* | ||
1002 | * Set cdev to NULL so we don't crash trying to | ||
1003 | * free it. | ||
1004 | * Also, why the hell we are returning early and | ||
1005 | * not attempt to register video output if cooling | ||
1006 | * device registration failed? | ||
1007 | * -- dtor | ||
1008 | */ | ||
1009 | device->cdev = NULL; | ||
1001 | return; | 1010 | return; |
1011 | } | ||
1002 | 1012 | ||
1003 | dev_info(&device->dev->dev, "registered as cooling_device%d\n", | 1013 | dev_info(&device->dev->dev, "registered as cooling_device%d\n", |
1004 | device->cdev->id); | 1014 | device->cdev->id); |