diff mbox

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

Message ID 1296391110.2283.187.camel@neuromancer (mailing list archive)
State Accepted
Commit e6fa47af5542df3383a78d7cc78f5d5ef63c0d42
Headers show

Commit Message

Stefan Achatz Jan. 30, 2011, 12:38 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
index 0fa23de..bbe294c 100644
--- a/drivers/hid/hid-roccat.c
+++ b/drivers/hid/hid-roccat.c
@@ -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);