Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: f_ncm: obtain cdev from function instead of driver_data

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>

authored by

Robert Baldyga and committed by
Felipe Balbi
35bfde36 f871cb9b

+1 -1
+1 -1
drivers/usb/gadget/function/f_ncm.c
··· 586 586 unsigned in_size; 587 587 struct usb_function *f = req->context; 588 588 struct f_ncm *ncm = func_to_ncm(f); 589 - struct usb_composite_dev *cdev = ep->driver_data; 589 + struct usb_composite_dev *cdev = f->config->cdev; 590 590 591 591 req->context = NULL; 592 592 if (req->status || req->actual != req->length) {