Skip to content

Commit

Permalink
V4L/DVB: cx18-alsa: fix memory leak in error condition
Browse files Browse the repository at this point in the history
If the stream is already in use, make sure we free up the memory allocated
earlier.

Thanks to Andy Wall for reviewing and pointing this out.

This work was sponsored by ONELAN Limited.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 485e319 commit 1a8e0e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/video/cx18/cx18-alsa-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static int snd_cx18_pcm_capture_open(struct snd_pcm_substream *substream)
/* See if the stream is available */
if (cx18_claim_stream(item, item->type)) {
/* No, it's already in use */
kfree(item);
return -EBUSY;
}

Expand Down

0 comments on commit 1a8e0e3

Please sign in to comment.