lkml.org 
[lkml]   [2003]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectMemleak in driver for the Specialix SX series cards.
Hello!

I see there is a memleak in driver for the Specialix SX series cards
on error exit path in sx_fw_ioctl() (both in 2.4 and 2.5).
See the patch.
Found with help of smatch + unfree script.

Bye,
Oleg

===== drivers/char/sx.c 1.13 vs edited =====
--- 1.13/drivers/char/sx.c Fri Nov 8 21:16:55 2002
+++ edited/drivers/char/sx.c Wed Mar 12 23:38:33 2003
@@ -1734,8 +1734,10 @@
if (copy_from_user(tmp, (char *)data + i,
(i + SX_CHUNK_SIZE >
nbytes) ? nbytes - i :
- SX_CHUNK_SIZE))
+ SX_CHUNK_SIZE)) {
+ kfree (tmp);
return -EFAULT;
+ }
memcpy_toio ((char *) (board->base2 + offset + i), tmp,
(i+SX_CHUNK_SIZE>nbytes)?nbytes-i:SX_CHUNK_SIZE);
}
-
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 13:33    [W:0.046 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site