Dinghao Liu f4dcf06bc6 ACPI: video: Fix NULL pointer dereference in acpi_video_bus_add()
acpi_video_bus_add_notify_handler() could free video->input and
set it to NULL on failure, but this failure would be missed in its
caller acpi_video_bus_add(). As a result, when an error happens in
acpi_dev_install_notify_handler(), acpi_video_bus_add() would call
acpi_video_bus_remove_notify_handler(), where a potential NULL pointer
video->input is dereferenced in input_unregister_device().

Fix this by adding a return value check and adjusting the following
error handling code.

Fixes: 6f7016819766 ("ACPI: video: Install Notify() handler directly")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-09-25 11:53:40 +02:00
..
2023-08-25 20:55:47 +02:00
2023-08-25 20:40:50 +02:00
2023-06-27 17:06:51 +02:00
2020-11-09 19:25:20 +01:00
2022-05-25 15:37:07 +02:00
2022-11-10 20:21:35 +01:00
2022-01-22 08:33:37 +02:00
2020-11-09 19:08:06 +01:00
2023-09-01 16:54:25 -07:00
2023-03-27 20:50:28 +02:00
2022-10-03 20:09:22 +02:00
2020-11-09 19:08:06 +01:00