Skip to content

Commit c1af8be

Browse files
committed
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 <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent a2fc3c8 commit c1af8be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/acpi/acpi_video.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,14 +2111,14 @@ static int acpi_video_bus_remove(struct acpi_device *device)
21112111

21122112
video = acpi_driver_data(device);
21132113

2114-
acpi_video_bus_remove_notify_handler(video);
2115-
acpi_video_bus_unregister_backlight(video);
2116-
acpi_video_bus_put_devices(video);
2117-
21182114
mutex_lock(&video_list_lock);
21192115
list_del(&video->entry);
21202116
mutex_unlock(&video_list_lock);
21212117

2118+
acpi_video_bus_remove_notify_handler(video);
2119+
acpi_video_bus_unregister_backlight(video);
2120+
acpi_video_bus_put_devices(video);
2121+
21222122
kfree(video->attached_array);
21232123
kfree(video);
21242124

0 commit comments

Comments
 (0)