Commit:     943c441948581bd01ab196a4d32da88bfa0f13ce
Parent:     bc92c32aa21cf2e8808f8cff0be0a2a653652e92
Author:     Wojtek Kaniewski <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 8 03:23:00 2006 -0800
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed Dec 20 10:14:27 2006 -0800

    USB: at91_udc: Cleanup variables after failure in 
    This patch zeroes some variables when usb_gadget_register_driver()
    fails. gadgetfs does a dummy registration to get the name of the USB
    driver and then waits for user-land driver. If someone plugs the cable
    in the meantime, bad things happen, because at91_udc has been left in
    inconsistent state.
    Signed-off-by: Wojtek Kaniewski <[EMAIL PROTECTED]>
    Acked-by: David Brownell <[EMAIL PROTECTED]>
    Cc: Andrew Victor <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
 drivers/usb/gadget/at91_udc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 38a2e11..1926d39 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1601,6 +1601,10 @@ int usb_gadget_register_driver (struct usb_gadget_driver 
        if (retval) {
                DBG("driver->bind() returned %d\n", retval);
                udc->driver = NULL;
+               udc-> = NULL;
+               udc-> = NULL;
+               udc->enabled = 0;
+               udc->selfpowered = 0;
                return retval;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to