Commit f4dcf06
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: 6f70168 ("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>1 parent 6465e26 commit f4dcf06
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2057 | 2057 | | |
2058 | 2058 | | |
2059 | 2059 | | |
2060 | | - | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
2061 | 2063 | | |
2062 | 2064 | | |
2063 | 2065 | | |
| |||
2067 | 2069 | | |
2068 | 2070 | | |
2069 | 2071 | | |
| 2072 | + | |
| 2073 | + | |
2070 | 2074 | | |
2071 | 2075 | | |
2072 | 2076 | | |
2073 | | - | |
2074 | 2077 | | |
2075 | 2078 | | |
2076 | 2079 | | |
| |||
0 commit comments