usb: gadget: f_ncm: obtain cdev from function instead of driver_data
authorRobert Baldyga <r.baldyga@samsung.com>
Wed, 16 Sep 2015 10:10:40 +0000 (12:10 +0200)
committerFelipe Balbi <balbi@ti.com>
Sun, 27 Sep 2015 15:54:31 +0000 (10:54 -0500)
The 'driver_data' field in ep0 is never set to pointer to cdev, so we
have to obtain it from another source as in this context ep->driver_data
contains invalid data.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_ncm.c

index 3f05c6bd57f0c3353b5a2973a3e344593834b5b5..394cdbfc40f193f968739c1d5b177f60b7898445 100644 (file)
@@ -586,7 +586,7 @@ static void ncm_ep0out_complete(struct usb_ep *ep, struct usb_request *req)
        unsigned                in_size;
        struct usb_function     *f = req->context;
        struct f_ncm            *ncm = func_to_ncm(f);
-       struct usb_composite_dev *cdev = ep->driver_data;
+       struct usb_composite_dev *cdev = f->config->cdev;
 
        req->context = NULL;
        if (req->status || req->actual != req->length) {