summaryrefslogtreecommitdiff
path: root/drivers/media/video/em28xx/em28xx-audio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-06 14:27:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-06 14:27:15 -0700
commit11f9b020fa921bb33fff65b947f6422fe15f4414 (patch)
tree9f974d8037480192202ed9f9020adb7f8f2f0b53 /drivers/media/video/em28xx/em28xx-audio.c
parente683b423007b9befec30c672c695d0e6abf87493 (diff)
parentdb98fb8b5b9210ba3b14fb984a26060e4afdb9f5 (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (33 commits) V4L/DVB (9103): em28xx: HVR-900 B3C0 - fix audio clicking issue V4L/DVB (9099): em28xx: Add detection for K-WORLD DVB-T 310U V4L/DVB (9092): gspca: Bad init values for sonixj ov7660. V4L/DVB (9080): gspca: Add a delay after writing to the sonixj sensors. V4L/DVB (9075): gspca: Bad check of returned status in i2c_read() spca561. V4L/DVB (9053): fix buffer overflow in uvc-video V4L/DVB (9043): S5H1420: Fix size of shadow-array to avoid overflow V4L/DVB (9037): Fix support for Hauppauge Nova-S SE V4L/DVB (9029): Fix deadlock in demux code V4L/DVB (8979): sms1xxx: Add new USB product ID for Hauppauge WinTV MiniStick V4L/DVB (8978): sms1xxx: fix product name for Hauppauge WinTV MiniStick V4L/DVB (8967): Use correct XC3028L firmware for AMD ATI TV Wonder 600 V4L/DVB (8963): s2255drv field count fix V4L/DVB (8961): zr36067: Fix RGBR pixel format V4L/DVB (8960): drivers/media/video/cafe_ccic.c needs mm.h V4L/DVB (8958): zr36067: Return proper bytes-per-line value V4L/DVB (8957): zr36067: Restore the default pixel format V4L/DVB (8955): bttv: Prevent NULL pointer dereference in radio_open V4L/DVB (8935): em28xx-cards: Remove duplicate entry (EM2800_BOARD_KWORLD_USB2800) V4L/DVB (8933): gspca: Disable light frquency for zc3xx cs2102 Kokom. ...
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 3c006103c1e..ac3292d7646 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -117,10 +117,10 @@ static void em28xx_audio_isocirq(struct urb *urb)
if (oldptr + length >= runtime->buffer_size) {
unsigned int cnt =
- runtime->buffer_size - oldptr - 1;
+ runtime->buffer_size - oldptr;
memcpy(runtime->dma_area + oldptr * stride, cp,
cnt * stride);
- memcpy(runtime->dma_area, cp + cnt,
+ memcpy(runtime->dma_area, cp + cnt * stride,
length * stride - cnt * stride);
} else {
memcpy(runtime->dma_area + oldptr * stride, cp,
@@ -161,8 +161,14 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
memset(dev->adev->transfer_buffer[i], 0x80, sb_size);
urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
- if (!urb)
+ if (!urb) {
+ em28xx_errdev("usb_alloc_urb failed!\n");
+ for (j = 0; j < i; j++) {
+ usb_free_urb(dev->adev->urb[j]);
+ kfree(dev->adev->transfer_buffer[j]);
+ }
return -ENOMEM;
+ }
urb->dev = dev->udev;
urb->context = dev;