Skip to content

Commit

Permalink
usb: gadget: uvc: use capped length value
Browse files Browse the repository at this point in the history
"req->length" is a capped version of "data->length".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Dan Carpenter authored and Felipe Balbi committed Mar 18, 2013
1 parent a33bb21 commit a5eaaa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/uvc_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ uvc_send_response(struct uvc_device *uvc, struct uvc_request_data *data)
req->length = min_t(unsigned int, uvc->event_length, data->length);
req->zero = data->length < uvc->event_length;

memcpy(req->buf, data->data, data->length);
memcpy(req->buf, data->data, req->length);

return usb_ep_queue(cdev->gadget->ep0, req, GFP_KERNEL);
}
Expand Down

0 comments on commit a5eaaa1

Please sign in to comment.