diff options
-rw-r--r-- | drivers/hid/hid-roccat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c index 0fa23dead5e1..bbe294c0dd9b 100644 --- a/drivers/hid/hid-roccat.c +++ b/drivers/hid/hid-roccat.c | |||
@@ -356,13 +356,16 @@ void roccat_disconnect(int minor) | |||
356 | 356 | ||
357 | mutex_lock(&devices_lock); | 357 | mutex_lock(&devices_lock); |
358 | device = devices[minor]; | 358 | device = devices[minor]; |
359 | devices[minor] = NULL; | ||
360 | mutex_unlock(&devices_lock); | 359 | mutex_unlock(&devices_lock); |
361 | 360 | ||
362 | device->exist = 0; /* TODO exist maybe not needed */ | 361 | device->exist = 0; /* TODO exist maybe not needed */ |
363 | 362 | ||
364 | device_destroy(device->dev->class, MKDEV(roccat_major, minor)); | 363 | device_destroy(device->dev->class, MKDEV(roccat_major, minor)); |
365 | 364 | ||
365 | mutex_lock(&devices_lock); | ||
366 | devices[minor] = NULL; | ||
367 | mutex_unlock(&devices_lock); | ||
368 | |||
366 | if (device->open) { | 369 | if (device->open) { |
367 | hid_hw_close(device->hid); | 370 | hid_hw_close(device->hid); |
368 | wake_up_interruptible(&device->wait); | 371 | wake_up_interruptible(&device->wait); |