Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stefan Achatz and committed by
Jiri Kosina
e6fa47af 74b643da

+4 -1
+4 -1
drivers/hid/hid-roccat.c
··· 356 356 357 357 mutex_lock(&devices_lock); 358 358 device = devices[minor]; 359 - devices[minor] = NULL; 360 359 mutex_unlock(&devices_lock); 361 360 362 361 device->exist = 0; /* TODO exist maybe not needed */ 363 362 364 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 369 if (device->open) { 367 370 hid_hw_close(device->hid); 368 371 wake_up_interruptible(&device->wait);