lkml.org 
[lkml]   [2001]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers/media/video/zr36120.c (repost)
Greetings,

I wanted to repost this zr36120 patch, both because so far it has gone
unnoticed, and because there was a problem with the text formatting which
is now fixed.

There is a bug in zr36120.c of not freeing memory on error paths. This one
is particularly dangerous, because kmalloc allocates a memory block the
size of an entire video clip! I simply free the local pointer, vcp, before
returning -EFAULT.

Philip

--- drivers/media/video/zr36120.c.orig Tue May 22 18:08:22 2001
+++ drivers/media/video/zr36120.c Tue May 22 18:08:49 2001
@@ -1195,8 +1195,10 @@
if (vcp==NULL)
return -ENOMEM;
if (vw.clipcount && copy_from_user(vcp,vw.clips,sizeof(s$
- return -EFAULT;
-
+ {
+ vfree(vcp);
+ return -EFAULT;
+ }
on = ztv->running;
if (on)
zoran_cap(ztv, 0);
-
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 12:53    [W:0.029 / U:2.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site