]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
HID: rmi: Check that the RMI_STARTED bit is set before unregistering the RMI transpor...
authorAndrew Duggan <aduggan@synaptics.com>
Wed, 23 Oct 2019 01:24:03 +0000 (01:24 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:47:27 +0000 (23:47 -0500)
commit819ae0f72a4ccae5890a38690f26e1ebae5b73e7
treeb6cb31a7abb0ab04916d8d0a034dfcb06aa10211
parent3ac17a35be83abc3d5c64a60d828a517209151fc
HID: rmi: Check that the RMI_STARTED bit is set before unregistering the RMI transport device

BugLink: https://bugs.launchpad.net/bugs/1860602
[ Upstream commit 8725aa4fa7ded30211ebd28bb1c9bae806eb3841 ]

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: Andrew Duggan <aduggan@synaptics.com>
Reported-by: Federico Cerutti <federico@ceres-c.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/hid-rmi.c