mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
ACPI video: correct error-handling code
backlight_device_register may return an ERR_PTR value rather than a valid pointer. Problem found by Julia Lawall, properly fixed by Zhang Rui. Signed-off-by: Zhang Rui <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
parent
6b7b284958
commit
e01ce79b7f
1 changed files with 3 additions and 1 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue