diff options
Diffstat (limited to 'drivers/media/usb/tm6000/tm6000-core.c')
-rw-r--r-- | drivers/media/usb/tm6000/tm6000-core.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/usb/tm6000/tm6000-core.c b/drivers/media/usb/tm6000/tm6000-core.c index 22cc0116deb6..7c32353c59db 100644 --- a/drivers/media/usb/tm6000/tm6000-core.c +++ b/drivers/media/usb/tm6000/tm6000-core.c | |||
@@ -40,10 +40,13 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req, | |||
40 | u8 *data = NULL; | 40 | u8 *data = NULL; |
41 | int delay = 5000; | 41 | int delay = 5000; |
42 | 42 | ||
43 | mutex_lock(&dev->usb_lock); | 43 | if (len) { |
44 | |||
45 | if (len) | ||
46 | data = kzalloc(len, GFP_KERNEL); | 44 | data = kzalloc(len, GFP_KERNEL); |
45 | if (!data) | ||
46 | return -ENOMEM; | ||
47 | } | ||
48 | |||
49 | mutex_lock(&dev->usb_lock); | ||
47 | 50 | ||
48 | if (req_type & USB_DIR_IN) | 51 | if (req_type & USB_DIR_IN) |
49 | pipe = usb_rcvctrlpipe(dev->udev, 0); | 52 | pipe = usb_rcvctrlpipe(dev->udev, 0); |