]> git.baikalelectronics.ru Git - kernel.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>
Sun, 23 Jan 2011 02:38:57 +0000 (18:38 -0800)
commit1a637c362665fd6833e7ffe9763d67bc54c4f8b1
tree751494124d88366fa8f9369911661bad2b7ad08d
parentc6bdb2eef35eb5d6577c89c42cb83cf8aad2fe72
USB: g_printer: fix bug in unregistration

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>
CC: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/printer.c