The patch number 8100 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Marcin Slusarz  <[EMAIL PROTECTED]>
 V4L/vivi: fix possible memory leak in vivi_fillbuff


Move allocation after first check and fix memory leak.

Noticed-by: Daniel Marjam??ki <[EMAIL PROTECTED]>
Signed-off-by: Marcin Slusarz <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/vivi.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff -r 7b49949141e3 -r cde4614b3266 linux/drivers/media/video/vivi.c
--- a/linux/drivers/media/video/vivi.c  Sun Jun 22 07:33:44 2008 -0300
+++ b/linux/drivers/media/video/vivi.c  Sun Jun 22 09:11:40 2008 +0000
@@ -342,13 +342,14 @@ static void vivi_fillbuff(struct vivi_de
        int hmax  = buf->vb.height;
        int wmax  = buf->vb.width;
        struct timeval ts;
-       char *tmpbuf = kmalloc(wmax * 2, GFP_ATOMIC);
+       char *tmpbuf;
        void *vbuf = videobuf_to_vmalloc(&buf->vb);
 
+       if (!vbuf)
+               return;
+
+       tmpbuf = kmalloc(wmax * 2, GFP_ATOMIC);
        if (!tmpbuf)
-               return;
-
-       if (!vbuf)
                return;
 
        for (h = 0; h < hmax; h++) {


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/cde4614b32668374a47108db1cc43bf484d78fe0

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to