lkml.org 
[lkml]   [2003]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Misc 2.5 Fixes: resrc-leak-i810


Free any read channel allocated earlier if allocation of write channel
fails.


sound/oss/i810_audio.c | 5 +++++
1 files changed, 5 insertions(+)

diff -puN sound/oss/i810_audio.c~resrc-leak-i810 sound/oss/i810_audio.c
--- linux-2.5.70-ds/sound/oss/i810_audio.c~resrc-leak-i810 2003-06-09 22:10:21.000000000 +0530
+++ linux-2.5.70-ds-dipankar/sound/oss/i810_audio.c 2003-06-09 22:16:04.000000000 +0530
@@ -2493,6 +2493,11 @@ found_virt:
}
if(file->f_mode & FMODE_WRITE) {
if((dmabuf->write_channel = card->alloc_pcm_channel(card)) == NULL) {
+ /* free any read channel allocated earlier */
+ if(file->f_mode & FMODE_READ)
+ card->free_pcm_channel(card,
+ dmabuf->read_channel->num);
+
kfree (card->states[i]);
card->states[i] = NULL;;
return -EBUSY;
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.046 / U:2.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site