]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ACPI / video: driver must be registered before checking for keypresses
authorAdrien Schildknecht <adrien+dev@schischi.me>
Mon, 4 Jan 2016 22:22:28 +0000 (23:22 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 5 Jan 2016 12:38:50 +0000 (13:38 +0100)
commitaecbd9b1bff6afbe349921b406b99d285b412820
tree002e2aea096bdb9c1f335f37bfe2ff7c19547c37
parent49eb5208220a9eef7529decbdefd95e4b94a928b
ACPI / video: driver must be registered before checking for keypresses

acpi_video_handles_brightness_key_presses() may use an uninitialized mutex.
The error has been reported by lockdep: DEBUG_LOCKS_WARN_ON(l->magic != l).
The function assumes that the video driver has been registered before being
called. As explained in the comment of acpi_video_init(), the registration
of the video class may be defered and thus may not take place in the init
function of the module.

Use completion mechanisms to make sure that
acpi_video_handles_brightness_key_presses() wait for the completion of
acpi_video_register() before using the mutex.
Also get rid of register_count since task completion can replace it.

Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_video.c