This is a note to let you know that I've just added the patch titled

    USB: g_printer: fix bug in unregistration

to the 2.6.37-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-g_printer-fix-bug-in-unregistration.patch
and it can be found in the queue-2.6.37 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From d5aa475180d03d45c5dc6134aa833f1b3e89c45e Mon Sep 17 00:00:00 2001
From: Alan Stern <[email protected]>
Date: Mon, 10 Jan 2011 11:23:05 -0500
Subject: USB: g_printer: fix bug in unregistration

From: Alan Stern <[email protected]>

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 <[email protected]>
CC: Roland Kletzing <[email protected]>
CC: Craig W. Nadler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/gadget/printer.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -1596,13 +1596,12 @@ cleanup(void)
        int status;
 
        mutex_lock(&usb_printer_gadget.lock_printer_io);
-       class_destroy(usb_gadget_class);
-       unregister_chrdev_region(g_printer_devno, 2);
-
        status = usb_gadget_unregister_driver(&printer_driver);
        if (status)
                ERROR(dev, "usb_gadget_unregister_driver %x\n", status);
 
+       unregister_chrdev_region(g_printer_devno, 2);
+       class_destroy(usb_gadget_class);
        mutex_unlock(&usb_printer_gadget.lock_printer_io);
 }
 module_exit(cleanup);


Patches currently in stable-queue which might be from [email protected] 
are

queue-2.6.37/usb-prevent-buggy-hubs-from-crashing-the-usb-stack.patch
queue-2.6.37/usb-ehci-fix-scheduling-while-atomic-during-suspend.patch
queue-2.6.37/usb-usb-storage-unusual_devs-entry-for-coby-mp3-player.patch
queue-2.6.37/usb-fix-race-between-root-hub-resume-and-wakeup-requests.patch
queue-2.6.37/usb-g_printer-fix-bug-in-unregistration.patch
queue-2.6.37/usb-usb-storage-unusual_devs-entry-for-camsport-evo.patch
queue-2.6.37/usb-ehci-fix-dma-deallocation-bug.patch
queue-2.6.37/usb-g_printer-fix-bug-in-module-parameter-definitions.patch
queue-2.6.37/usb-serial-add-missing-.usb_driver-field-in-serial-drivers.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to