• Dinghao Liu's avatar
    ACPI: video: Fix NULL pointer dereference in acpi_video_bus_add() · f4dcf06b
    Dinghao Liu authored
    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: 6f701681 ("ACPI: video: Install Notify() handler directly")
    Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
    [ rjw: Subject and changelog edits ]
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    f4dcf06b
acpi_video.c 59 KB