mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
HID: roccat: Fix bug that prevented roccat chardev from removing devices
pointer to device was cleared too early. This is fixed now. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
74b643dac4
commit
e6fa47af55
1 changed files with 4 additions and 1 deletions
|
@ -356,13 +356,16 @@ void roccat_disconnect(int minor)
|
||||||
|
|
||||||
mutex_lock(&devices_lock);
|
mutex_lock(&devices_lock);
|
||||||
device = devices[minor];
|
device = devices[minor];
|
||||||
devices[minor] = NULL;
|
|
||||||
mutex_unlock(&devices_lock);
|
mutex_unlock(&devices_lock);
|
||||||
|
|
||||||
device->exist = 0; /* TODO exist maybe not needed */
|
device->exist = 0; /* TODO exist maybe not needed */
|
||||||
|
|
||||||
device_destroy(device->dev->class, MKDEV(roccat_major, minor));
|
device_destroy(device->dev->class, MKDEV(roccat_major, minor));
|
||||||
|
|
||||||
|
mutex_lock(&devices_lock);
|
||||||
|
devices[minor] = NULL;
|
||||||
|
mutex_unlock(&devices_lock);
|
||||||
|
|
||||||
if (device->open) {
|
if (device->open) {
|
||||||
hid_hw_close(device->hid);
|
hid_hw_close(device->hid);
|
||||||
wake_up_interruptible(&device->wait);
|
wake_up_interruptible(&device->wait);
|
||||||
|
|
Loading…
Reference in a new issue