aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/class/audio.c')
-rw-r--r--drivers/usb/class/audio.c48
1 files changed, 16 insertions, 32 deletions
diff --git a/drivers/usb/class/audio.c b/drivers/usb/class/audio.c
index f432b7d5b235..f8f21567cc22 100644
--- a/drivers/usb/class/audio.c
+++ b/drivers/usb/class/audio.c
@@ -649,14 +649,10 @@ static void usbin_stop(struct usb_audiodev *as)
649 } 649 }
650 } 650 }
651 set_current_state(TASK_RUNNING); 651 set_current_state(TASK_RUNNING);
652 if (u->durb[0].urb->transfer_buffer) 652 kfree(u->durb[0].urb->transfer_buffer);
653 kfree(u->durb[0].urb->transfer_buffer); 653 kfree(u->durb[1].urb->transfer_buffer);
654 if (u->durb[1].urb->transfer_buffer) 654 kfree(u->surb[0].urb->transfer_buffer);
655 kfree(u->durb[1].urb->transfer_buffer); 655 kfree(u->surb[1].urb->transfer_buffer);
656 if (u->surb[0].urb->transfer_buffer)
657 kfree(u->surb[0].urb->transfer_buffer);
658 if (u->surb[1].urb->transfer_buffer)
659 kfree(u->surb[1].urb->transfer_buffer);
660 u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer = 656 u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer =
661 u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL; 657 u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL;
662} 658}
@@ -1009,21 +1005,17 @@ static int usbin_start(struct usb_audiodev *as)
1009 u->phase = 0; 1005 u->phase = 0;
1010 maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format)); 1006 maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format));
1011 bufsz = DESCFRAMES * maxsze; 1007 bufsz = DESCFRAMES * maxsze;
1012 if (u->durb[0].urb->transfer_buffer) 1008 kfree(u->durb[0].urb->transfer_buffer);
1013 kfree(u->durb[0].urb->transfer_buffer);
1014 u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); 1009 u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);
1015 u->durb[0].urb->transfer_buffer_length = bufsz; 1010 u->durb[0].urb->transfer_buffer_length = bufsz;
1016 if (u->durb[1].urb->transfer_buffer) 1011 kfree(u->durb[1].urb->transfer_buffer);
1017 kfree(u->durb[1].urb->transfer_buffer);
1018 u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); 1012 u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);
1019 u->durb[1].urb->transfer_buffer_length = bufsz; 1013 u->durb[1].urb->transfer_buffer_length = bufsz;
1020 if (u->syncpipe) { 1014 if (u->syncpipe) {
1021 if (u->surb[0].urb->transfer_buffer) 1015 kfree(u->surb[0].urb->transfer_buffer);
1022 kfree(u->surb[0].urb->transfer_buffer);
1023 u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); 1016 u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);
1024 u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES; 1017 u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES;
1025 if (u->surb[1].urb->transfer_buffer) 1018 kfree(u->surb[1].urb->transfer_buffer);
1026 kfree(u->surb[1].urb->transfer_buffer);
1027 u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); 1019 u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);
1028 u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES; 1020 u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES;
1029 } 1021 }
@@ -1128,14 +1120,10 @@ static void usbout_stop(struct usb_audiodev *as)
1128 } 1120 }
1129 } 1121 }
1130 set_current_state(TASK_RUNNING); 1122 set_current_state(TASK_RUNNING);
1131 if (u->durb[0].urb->transfer_buffer) 1123 kfree(u->durb[0].urb->transfer_buffer);
1132 kfree(u->durb[0].urb->transfer_buffer); 1124 kfree(u->durb[1].urb->transfer_buffer);
1133 if (u->durb[1].urb->transfer_buffer) 1125 kfree(u->surb[0].urb->transfer_buffer);
1134 kfree(u->durb[1].urb->transfer_buffer); 1126 kfree(u->surb[1].urb->transfer_buffer);
1135 if (u->surb[0].urb->transfer_buffer)
1136 kfree(u->surb[0].urb->transfer_buffer);
1137 if (u->surb[1].urb->transfer_buffer)
1138 kfree(u->surb[1].urb->transfer_buffer);
1139 u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer = 1127 u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer =
1140 u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL; 1128 u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL;
1141} 1129}
@@ -1376,21 +1364,17 @@ static int usbout_start(struct usb_audiodev *as)
1376 u->phase = 0; 1364 u->phase = 0;
1377 maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format)); 1365 maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format));
1378 bufsz = DESCFRAMES * maxsze; 1366 bufsz = DESCFRAMES * maxsze;
1379 if (u->durb[0].urb->transfer_buffer) 1367 kfree(u->durb[0].urb->transfer_buffer);
1380 kfree(u->durb[0].urb->transfer_buffer);
1381 u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); 1368 u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);
1382 u->durb[0].urb->transfer_buffer_length = bufsz; 1369 u->durb[0].urb->transfer_buffer_length = bufsz;
1383 if (u->durb[1].urb->transfer_buffer) 1370 kfree(u->durb[1].urb->transfer_buffer);
1384 kfree(u->durb[1].urb->transfer_buffer);
1385 u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); 1371 u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL);
1386 u->durb[1].urb->transfer_buffer_length = bufsz; 1372 u->durb[1].urb->transfer_buffer_length = bufsz;
1387 if (u->syncpipe) { 1373 if (u->syncpipe) {
1388 if (u->surb[0].urb->transfer_buffer) 1374 kfree(u->surb[0].urb->transfer_buffer);
1389 kfree(u->surb[0].urb->transfer_buffer);
1390 u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); 1375 u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);
1391 u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES; 1376 u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES;
1392 if (u->surb[1].urb->transfer_buffer) 1377 kfree(u->surb[1].urb->transfer_buffer);
1393 kfree(u->surb[1].urb->transfer_buffer);
1394 u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); 1378 u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL);
1395 u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES; 1379 u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES;
1396 } 1380 }