Commit c60e4c00 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix resource leak in i810 driver

From: Dipankar Sarma <dipankar@in.ibm.com>

Free any read channel allocated earlier if allocation of write channel
fails.  (From 2.4).
parent e9529a6c
......@@ -2493,6 +2493,11 @@ static int i810_open(struct inode *inode, struct file *file)
}
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment