mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-01 00:36:40 +09:00
USB: g_printer: fix bug in unregistration
commit 8582d86143 upstream.
The allocated chardevice region range is only 1 device but on
unregister it currently tries to deregister 2.
Found this while doing a insmod/rmmod/insmod/rm... of the module
which seemed to eat major numbers.
Signed-off-by: Fabian Godehardt <fg@emlix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
aa5f85cae9
commit
17195239b6
@@ -1611,7 +1611,7 @@ cleanup(void)
|
||||
if (status)
|
||||
ERROR(dev, "usb_gadget_unregister_driver %x\n", status);
|
||||
|
||||
unregister_chrdev_region(g_printer_devno, 2);
|
||||
unregister_chrdev_region(g_printer_devno, 1);
|
||||
class_destroy(usb_gadget_class);
|
||||
mutex_unlock(&usb_printer_gadget.lock_printer_io);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user