Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6fa47af authored by Stefan Achatz's avatar Stefan Achatz Committed by Jiri Kosina
Browse files

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: default avatarStefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 74b643da
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -356,13 +356,16 @@ void roccat_disconnect(int minor)

	mutex_lock(&devices_lock);
	device = devices[minor];
	devices[minor] = NULL;
	mutex_unlock(&devices_lock);

	device->exist = 0; /* TODO exist maybe not needed */

	device_destroy(device->dev->class, MKDEV(roccat_major, minor));

	mutex_lock(&devices_lock);
	devices[minor] = NULL;
	mutex_unlock(&devices_lock);
	
	if (device->open) {
		hid_hw_close(device->hid);
		wake_up_interruptible(&device->wait);