From: Skip Hansen Date: Fri, 1 Sep 2006 22:26:27 +0000 (-0700) Subject: gadgetfs patch for ep0out X-Git-Tag: MMI-PSA29.97-13-9~47266^2~38 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=997694defd085f4dd168c6e7e0e82382c5be9db4;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git gadgetfs patch for ep0out For ep0out transfers (rare), be sure to copy the right data to userspace. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index a38b6af2c358..4655522a08d9 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c @@ -1015,7 +1015,7 @@ ep0_read (struct file *fd, char __user *buf, size_t len, loff_t *ptr) else { len = min (len, (size_t)dev->req->actual); // FIXME don't call this with the spinlock held ... - if (copy_to_user (buf, &dev->req->buf, len)) + if (copy_to_user (buf, dev->req->buf, len)) retval = -EFAULT; clean_req (dev->gadget->ep0, dev->req); /* NOTE userspace can't yet choose to stall */