diff options
author | Hans de Goede <hdegoede@redhat.com> | 2022-04-28 17:53:51 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-09-02 09:57:14 +0200 |
commit | c1af8bec569dd6b8d874c14455ab02398c3d34cd (patch) | |
tree | 850f52df1a05fac33bbd7ade86fdaa8649d19897 /drivers/acpi/acpi_video.c | |
parent | a2fc3c899bb091ec69cd74d4d69d71f8b2acdc11 (diff) |
ACPI: video: Remove acpi_video_bus from list before tearing it down
Move the list_del removing an acpi_video_bus from video_bus_head
on teardown to before the teardown is done, to avoid code iterating
over the video_bus_head list seeing acpi_video_bus objects on there
which are (partly) torn down already.
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/acpi/acpi_video.c')
-rw-r--r-- | drivers/acpi/acpi_video.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index 5cbe2196176d..cde8ffa9f0b8 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -2111,14 +2111,14 @@ static int acpi_video_bus_remove(struct acpi_device *device) video = acpi_driver_data(device); - acpi_video_bus_remove_notify_handler(video); - acpi_video_bus_unregister_backlight(video); - acpi_video_bus_put_devices(video); - mutex_lock(&video_list_lock); list_del(&video->entry); mutex_unlock(&video_list_lock); + acpi_video_bus_remove_notify_handler(video); + acpi_video_bus_unregister_backlight(video); + acpi_video_bus_put_devices(video); + kfree(video->attached_array); kfree(video); |