ACPI / video: Fix acpi_video _register vs _unregister_backlight race
authorHans de Goede <hdegoede@redhat.com>
Tue, 16 Jun 2015 14:27:54 +0000 (16:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 18 Jun 2015 23:11:14 +0000 (01:11 +0200)
commit2a8b18e9fb650ab5c637005a7506045c46ed2b0e
tree637a4660e3ba3e89e8c3bea3b709712c4bcb333e
parent7ee33baabcae765e1eda73b988a62fe102c0ce76
ACPI / video: Fix acpi_video _register vs _unregister_backlight race

It is possible for a native backlight driver to load while
acpi_video_register is running, which may lead to
acpi_video_unregister_backlight being called while acpi_video_register
is running and the 2 racing against eachother.

The register_count variable protects against this, but not in a thread
safe manner, this commit adds locking to make this thread safe.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_video.c