sx memleak.

From: davej@codemonkey.org.uk
Date: Wed May 14 2003 - 22:31:03 EST


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/char/sx.c linux-2.5/drivers/char/sx.c
--- bk-linus/drivers/char/sx.c 2003-05-14 01:32:18.000000000 +0100
+++ linux-2.5/drivers/char/sx.c 2003-04-26 15:08:04.000000000 +0100
@@ -1739,8 +1739,10 @@ static int sx_fw_ioctl (struct inode *in
                                 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/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:55 EST