]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/ether.c
USB-CDC: correct wrong alignment in ether.c
[u-boot] / drivers / usb / gadget / ether.c
index 283049ebe620590f0c7cd69cc52dc4a4524fc9a9..9fc6a369c31ef904232d15057abf322d9e2836e9 100644 (file)
@@ -677,7 +677,7 @@ static struct usb_gadget_strings    stringtab = {
 
 /*============================================================================*/
 static u8 control_req[USB_BUFSIZ];
-static u8 status_req[STATUS_BYTECOUNT];
+static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
 
 
 
@@ -801,7 +801,7 @@ done:
 
        /* on error, disable any endpoints  */
        if (result < 0) {
-               if (!subset_active(dev))
+               if (!subset_active(dev) && dev->status_ep)
                        (void) usb_ep_disable (dev->status_ep);
                dev->status = NULL;
                (void) usb_ep_disable (dev->in_ep);
@@ -1726,14 +1726,13 @@ autoconf_fail:
        /* ... and maybe likewise for status transfer */
 #if defined(DEV_CONFIG_CDC)
        if (dev->status_ep) {
-               dev->stat_req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
-               dev->stat_req->buf = status_req;
+               dev->stat_req = usb_ep_alloc_request(dev->status_ep, GFP_KERNEL);
                if (!dev->stat_req) {
-                       dev->stat_req->buf=NULL;
-                       usb_ep_free_request (gadget->ep0, dev->req);
+                       usb_ep_free_request (dev->status_ep, dev->req);
 
                        goto fail;
                }
+               dev->stat_req->buf = status_req;
                dev->stat_req->context = NULL;
        }
 #endif