]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: g_printer: fix bug in unregistration
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 10 Jan 2011 16:23:05 +0000 (11:23 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 22:46:42 +0000 (14:46 -0800)
commit2b9ec6cfec78f22e64916db10f958384369fd0f5
tree4f436d2a0864f65d076724d2eb578fbbc51a2ea4
parent244ccf5a704afee9f628908abf089bd5d6cc9abd
USB: g_printer: fix bug in unregistration

commit d5aa475180d03d45c5dc6134aa833f1b3e89c45e upstream.

This patch (as1441) fixes a bug in g_printer.  The gadget driver, char
device number, and class device should be unregistered in reverse
order of registration.  As it is now, when the module is unloaded the
class device gets unregistered first, causing a crash when the unbind
method tries to access it.

This fixes Bugzilla #25882.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Roland Kletzing <devzero@web.de>
CC: Craig W. Nadler <craig@nadler.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/printer.c