From: Devin Heitmueller Date: Sat, 12 Dec 2009 20:38:53 +0000 (-0300) Subject: V4L/DVB: cx18-alsa: fix memory leak in error condition X-Git-Tag: v2.6.34-rc1~280^2~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a8e0e33881c9dd8cf3514bfd0b5a7ef148da929;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git V4L/DVB: cx18-alsa: fix memory leak in error condition 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/cx18/cx18-alsa-pcm.c b/drivers/media/video/cx18/cx18-alsa-pcm.c index 05cb8f1..e14f8e4 100644 --- a/drivers/media/video/cx18/cx18-alsa-pcm.c +++ b/drivers/media/video/cx18/cx18-alsa-pcm.c @@ -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; }