From: Fabian Godehardt Date: Thu, 1 Sep 2011 12:15:46 +0000 (+0200) Subject: USB: g_printer: fix bug in unregistration X-Git-Tag: next-20111004~8^2~50 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8582d86143c690c68cc42f996def466a035bee34;p=karo-tx-linux.git USB: g_printer: fix bug in unregistration 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 Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 68a0efbc2719..65a8834f274b 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c @@ -1594,7 +1594,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); }