Skip to contentSkip to conversation

HID: roccat: Fixed bug that prevented roccat chardev from removing devices

PATCH Applied Stefan Achatz 1 participant 1 message Jan 30, 2011

Subsystems (2)
lore
Share & tools
lore

Stefan Achatz

author maintainer
#0 lore raw

PATCH 8/8 HID: roccat: Fixed bug that prevented roccat chardev from removing devices

pointer to device was cleared too early. This is fixed now.

---
 drivers/hid/hid-roccat.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/hid/hid-roccat.c +4 -1
index 0fa23de..bbe294c 100644
@@ -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);
Signature · 1 line
1.7.3.4