diff options
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
| -rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 94378ccb7505..5d882a44e3ee 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
| @@ -62,9 +62,15 @@ static int em28xx_isoc_audio_deinit(struct em28xx *dev) | |||
| 62 | 62 | ||
| 63 | dprintk("Stopping isoc\n"); | 63 | dprintk("Stopping isoc\n"); |
| 64 | for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { | 64 | for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { |
| 65 | usb_unlink_urb(dev->adev.urb[i]); | 65 | if (!irqs_disabled()) |
| 66 | usb_kill_urb(dev->adev.urb[i]); | ||
| 67 | else | ||
| 68 | usb_unlink_urb(dev->adev.urb[i]); | ||
| 66 | usb_free_urb(dev->adev.urb[i]); | 69 | usb_free_urb(dev->adev.urb[i]); |
| 67 | dev->adev.urb[i] = NULL; | 70 | dev->adev.urb[i] = NULL; |
| 71 | |||
| 72 | kfree(dev->adev.transfer_buffer[i]); | ||
| 73 | dev->adev.transfer_buffer[i] = NULL; | ||
| 68 | } | 74 | } |
| 69 | 75 | ||
| 70 | return 0; | 76 | return 0; |
| @@ -389,11 +395,15 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream, | |||
| 389 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream | 395 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream |
| 390 | *substream) | 396 | *substream) |
| 391 | { | 397 | { |
| 392 | struct em28xx *dev; | 398 | unsigned long flags; |
| 393 | 399 | ||
| 400 | struct em28xx *dev; | ||
| 394 | snd_pcm_uframes_t hwptr_done; | 401 | snd_pcm_uframes_t hwptr_done; |
| 402 | |||
| 395 | dev = snd_pcm_substream_chip(substream); | 403 | dev = snd_pcm_substream_chip(substream); |
| 404 | spin_lock_irqsave(&dev->adev.slock, flags); | ||
| 396 | hwptr_done = dev->adev.hwptr_done_capture; | 405 | hwptr_done = dev->adev.hwptr_done_capture; |
| 406 | spin_unlock_irqrestore(&dev->adev.slock, flags); | ||
| 397 | 407 | ||
| 398 | return hwptr_done; | 408 | return hwptr_done; |
| 399 | } | 409 | } |
