summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvc_status.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/uvc/uvc_status.c')
-rw-r--r--drivers/media/video/uvc/uvc_status.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvc_status.c b/drivers/media/video/uvc/uvc_status.c
index 75e678ac54e..5d60b264d59 100644
--- a/drivers/media/video/uvc/uvc_status.c
+++ b/drivers/media/video/uvc/uvc_status.c
@@ -177,9 +177,15 @@ int uvc_status_init(struct uvc_device *dev)
uvc_input_init(dev);
+ dev->status = kzalloc(UVC_MAX_STATUS_SIZE, GFP_KERNEL);
+ if (dev->status == NULL)
+ return -ENOMEM;
+
dev->int_urb = usb_alloc_urb(0, GFP_KERNEL);
- if (dev->int_urb == NULL)
+ if (dev->int_urb == NULL) {
+ kfree(dev->status);
return -ENOMEM;
+ }
pipe = usb_rcvintpipe(dev->udev, ep->desc.bEndpointAddress);
@@ -192,7 +198,7 @@ int uvc_status_init(struct uvc_device *dev)
interval = fls(interval) - 1;
usb_fill_int_urb(dev->int_urb, dev->udev, pipe,
- dev->status, sizeof dev->status, uvc_status_complete,
+ dev->status, UVC_MAX_STATUS_SIZE, uvc_status_complete,
dev, interval);
return usb_submit_urb(dev->int_urb, GFP_KERNEL);
@@ -202,6 +208,7 @@ void uvc_status_cleanup(struct uvc_device *dev)
{
usb_kill_urb(dev->int_urb);
usb_free_urb(dev->int_urb);
+ kfree(dev->status);
uvc_input_cleanup(dev);
}