aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/helper.c')
-rw-r--r--sound/usb/helper.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/usb/helper.c b/sound/usb/helper.c
index c1db28f874c2..620902463c6e 100644
--- a/sound/usb/helper.c
+++ b/sound/usb/helper.c
@@ -86,14 +86,22 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
86{ 86{
87 int err; 87 int err;
88 void *buf = NULL; 88 void *buf = NULL;
89 int timeout;
89 90
90 if (size > 0) { 91 if (size > 0) {
91 buf = kmemdup(data, size, GFP_KERNEL); 92 buf = kmemdup(data, size, GFP_KERNEL);
92 if (!buf) 93 if (!buf)
93 return -ENOMEM; 94 return -ENOMEM;
94 } 95 }
96
97 if (requesttype & USB_DIR_IN)
98 timeout = USB_CTRL_GET_TIMEOUT;
99 else
100 timeout = USB_CTRL_SET_TIMEOUT;
101
95 err = usb_control_msg(dev, pipe, request, requesttype, 102 err = usb_control_msg(dev, pipe, request, requesttype,
96 value, index, buf, size, 1000); 103 value, index, buf, size, timeout);
104
97 if (size > 0) { 105 if (size > 0) {
98 memcpy(data, buf, size); 106 memcpy(data, buf, size);
99 kfree(buf); 107 kfree(buf);