ACPI: video: correct acpi_video_bus_add error processing
authorAaron Lu <aaron.lu@intel.com>
Thu, 25 Apr 2013 02:47:49 +0000 (02:47 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 25 Apr 2013 10:53:19 +0000 (12:53 +0200)
commit91e13aa37023437c260c85a3f17308052bbfbfa2
treec867075f3975ca0d3611e99c5be6f102da55f326
parenta6432ded299726f123b93d0132fead200551535c
ACPI: video: correct acpi_video_bus_add error processing

acpi_video_bus_get_devices() may fail due to some video output device
doesn't have the _ADR method, and in this case, the error processing
is to simply free the video structure in acpi_video_bus_add(), while
leaving those already registered video output devices in the wild,
which means for some video output device, we have already registered
a backlight interface and installed a notification handler for it.
So it can happen when user is using this system, on hotkey pressing,
the notification handler will send a keycode through a non-existing
input device, causing kernel freeze.

To solve this problem, free all those already registered video output
devices once something goes wrong in acpi_video_bus_get_devices(), so
that no wild backlight interfaces and notification handlers exist.

References: https://bugzilla.kernel.org/show_bug.cgi?id=51731
Reported-and-tested-by: <i-tek@web.de>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/video.c