Skip to content
Commit 564ce6f2 authored by Andrew Duggan's avatar Andrew Duggan Committed by Paul Gortmaker
Browse files

HID: rmi: Check that the RMI_STARTED bit is set before unregistering the RMI transport device

commit 8725aa4f

 upstream.

In the event that the RMI device is unreachable, the calls to rmi_set_mode() or
rmi_set_page() will fail before registering the RMI transport device. When the
device is removed, rmi_remove() will call rmi_unregister_transport_device()
which will attempt to access the rmi_dev pointer which was not set.
This patch adds a check of the RMI_STARTED bit before calling
rmi_unregister_transport_device().  The RMI_STARTED bit is only set
after rmi_register_transport_device() completes successfully.

The kernel oops was reported in this message:
https://www.spinics.net/lists/linux-input/msg58433.html

[jkosina@suse.cz: reworded changelog as agreed with Andrew]
Signed-off-by: default avatarAndrew Duggan <aduggan@synaptics.com>
Reported-by: default avatarFederico Cerutti <federico@ceres-c.it>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 7ed8a156
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment