diff options
author | Robert Krakora <rob.krakora@messagenetsystems.com> | 2009-02-08 11:09:11 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:44 -0400 |
commit | aa5a1821859c9c2915bc00e79f6e01e619df6e8f (patch) | |
tree | 9d00a558f3f3e8ba4ec624edc7e59ba8e1e0cc96 /drivers/media/video/em28xx/em28xx-audio.c | |
parent | 3e099baff451affd13a93c6fed216943e01b80fd (diff) |
V4L/DVB (10518): em28xx: Fix for em28xx memory leak and function rename
Fix for em28xx memory leak and function rename
Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 7a62c77b8485..c698d3c9690f 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
@@ -56,7 +56,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); | |||
56 | 56 | ||
57 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 57 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
58 | 58 | ||
59 | static int em28xx_isoc_audio_deinit(struct em28xx *dev) | 59 | static int em28xx_deinit_isoc_audio(struct em28xx *dev) |
60 | { | 60 | { |
61 | int i; | 61 | int i; |
62 | 62 | ||
@@ -66,6 +66,7 @@ static int em28xx_isoc_audio_deinit(struct em28xx *dev) | |||
66 | usb_kill_urb(dev->adev.urb[i]); | 66 | usb_kill_urb(dev->adev.urb[i]); |
67 | else | 67 | else |
68 | usb_unlink_urb(dev->adev.urb[i]); | 68 | usb_unlink_urb(dev->adev.urb[i]); |
69 | |||
69 | usb_free_urb(dev->adev.urb[i]); | 70 | usb_free_urb(dev->adev.urb[i]); |
70 | dev->adev.urb[i] = NULL; | 71 | dev->adev.urb[i] = NULL; |
71 | 72 | ||
@@ -87,6 +88,20 @@ static void em28xx_audio_isocirq(struct urb *urb) | |||
87 | unsigned int stride; | 88 | unsigned int stride; |
88 | struct snd_pcm_substream *substream; | 89 | struct snd_pcm_substream *substream; |
89 | struct snd_pcm_runtime *runtime; | 90 | struct snd_pcm_runtime *runtime; |
91 | |||
92 | switch (urb->status) { | ||
93 | case 0: /* success */ | ||
94 | case -ETIMEDOUT: /* NAK */ | ||
95 | break; | ||
96 | case -ECONNRESET: /* kill */ | ||
97 | case -ENOENT: | ||
98 | case -ESHUTDOWN: | ||
99 | return; | ||
100 | default: /* error */ | ||
101 | dprintk("urb completition error %d.\n", urb->status); | ||
102 | break; | ||
103 | } | ||
104 | |||
90 | if (dev->adev.capture_pcm_substream) { | 105 | if (dev->adev.capture_pcm_substream) { |
91 | substream = dev->adev.capture_pcm_substream; | 106 | substream = dev->adev.capture_pcm_substream; |
92 | runtime = substream->runtime; | 107 | runtime = substream->runtime; |
@@ -197,8 +212,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev) | |||
197 | for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { | 212 | for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { |
198 | errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); | 213 | errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); |
199 | if (errCode) { | 214 | if (errCode) { |
200 | em28xx_isoc_audio_deinit(dev); | 215 | em28xx_deinit_isoc_audio(dev); |
201 | |||
202 | return errCode; | 216 | return errCode; |
203 | } | 217 | } |
204 | } | 218 | } |
@@ -218,7 +232,7 @@ static int em28xx_cmd(struct em28xx *dev, int cmd, int arg) | |||
218 | em28xx_init_audio_isoc(dev); | 232 | em28xx_init_audio_isoc(dev); |
219 | } else if (dev->adev.capture_stream == STREAM_ON && arg == 0) { | 233 | } else if (dev->adev.capture_stream == STREAM_ON && arg == 0) { |
220 | dev->adev.capture_stream = STREAM_OFF; | 234 | dev->adev.capture_stream = STREAM_OFF; |
221 | em28xx_isoc_audio_deinit(dev); | 235 | em28xx_deinit_isoc_audio(dev); |
222 | } else { | 236 | } else { |
223 | printk(KERN_ERR "An underrun very likely occurred. " | 237 | printk(KERN_ERR "An underrun very likely occurred. " |
224 | "Ignoring it.\n"); | 238 | "Ignoring it.\n"); |