diff options
author | Hans de Goede <hdegoede@redhat.com> | 2016-01-14 09:41:46 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-15 22:09:07 +0100 |
commit | 14e9355363fc5bf98ba63875e117f29d1902d253 (patch) | |
tree | 69459db928537e417a1e289c5c198dc20762a73e /drivers/acpi | |
parent | 970530cd00578d9dd9de45ecf297b28f6809c738 (diff) | |
download | linux-14e9355363fc5bf98ba63875e117f29d1902d253.tar.bz2 |
ACPI / video: Fix using an uninitialized mutex / list_head in acpi_video_handles_brightness_key_presses()
If acpi_video_handles_brightness_key_presses() was called before
acpi_video_register(), it would use the video_list mutex / list_head
uninitialized.
This patch fixes this by using DEFINE_MUTEX / LIST_HEAD when declaring
these, instead of initializing them runtime from acpi_video_register().
Fixes: 90b066b15eda "ACPI / video: Add a acpi_video_handles_brightness_key_presses() helper"
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_video.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index d95aaa51f733..408b014f8b64 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -92,8 +92,8 @@ module_param(only_lcd, bool, 0444); static int register_count; static DEFINE_MUTEX(register_count_mutex); -static struct mutex video_list_lock; -static struct list_head video_bus_head; +static DEFINE_MUTEX(video_list_lock); +static LIST_HEAD(video_bus_head); static int acpi_video_bus_add(struct acpi_device *device); static int acpi_video_bus_remove(struct acpi_device *device); static void acpi_video_bus_notify(struct acpi_device *device, u32 event); @@ -2067,9 +2067,6 @@ int acpi_video_register(void) goto leave; } - mutex_init(&video_list_lock); - INIT_LIST_HEAD(&video_bus_head); - dmi_check_system(video_dmi_table); ret = acpi_bus_register_driver(&acpi_video_bus); |