]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/acpi/video.c
Merge branch 'video-error-case' into release
[net-next-2.6.git] / drivers / acpi / video.c
index 3b063a6ac52ea38f7cc9bce45a4e8fb98cf32035..72e76b4b6538f2da73ca4b9060e3cf12ce1808fc 100644 (file)
@@ -999,8 +999,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
                sprintf(name, "acpi_video%d", count++);
                device->backlight = backlight_device_register(name,
                        NULL, device, &acpi_backlight_ops);
-               device->backlight->props.max_brightness = device->brightness->count-3;
                kfree(name);
+               if (IS_ERR(device->backlight))
+                       return;
+               device->backlight->props.max_brightness = device->brightness->count-3;
 
                result = sysfs_create_link(&device->backlight->dev.kobj,
                                           &device->dev->dev.kobj, "device");