From: Keith Packard Date: Thu, 6 Aug 2009 22:57:54 +0000 (-0700) Subject: ACPI: don't free non-existent backlight in acpi video module X-Git-Tag: v2.6.31-rc9~33^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e29b3ee3b005897fbdcfdd4b3190776e38739d70;p=profile%2Fivi%2Fkernel-x86-ivi.git ACPI: don't free non-existent backlight in acpi video module acpi_video_put_one_device was attempting to remove sysfs entries and unregister a backlight device without first checking that said backlight device structure had been created. Signed-off-by: Keith Packard Acked-by: Zhang Rui Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 8851315..60ea984 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -2004,8 +2004,11 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device) status = acpi_remove_notify_handler(device->dev->handle, ACPI_DEVICE_NOTIFY, acpi_video_device_notify); - sysfs_remove_link(&device->backlight->dev.kobj, "device"); - backlight_device_unregister(device->backlight); + if (device->backlight) { + sysfs_remove_link(&device->backlight->dev.kobj, "device"); + backlight_device_unregister(device->backlight); + device->backlight = NULL; + } if (device->cdev) { sysfs_remove_link(&device->dev->dev.kobj, "thermal_cooling");