浏览代码

[MTD] cfi_cmdset_0002: Plugged a mem leak.

Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Joern Engel 20 年之前
父节点
当前提交
6a8b4d319c
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      drivers/mtd/chips/cfi_cmdset_0020.c

+ 4 - 1
drivers/mtd/chips/cfi_cmdset_0020.c

@@ -4,7 +4,7 @@
  *
  *
  * (C) 2000 Red Hat. GPL'd
  * (C) 2000 Red Hat. GPL'd
  *
  *
- * $Id: cfi_cmdset_0020.c,v 1.17 2004/11/20 12:49:04 dwmw2 Exp $
+ * $Id: cfi_cmdset_0020.c,v 1.19 2005/07/13 15:52:45 dwmw2 Exp $
  * 
  * 
  * 10/10/2000	Nicolas Pitre <nico@cam.org>
  * 10/10/2000	Nicolas Pitre <nico@cam.org>
  * 	- completely revamped method functions so they are aware and
  * 	- completely revamped method functions so they are aware and
@@ -16,6 +16,8 @@
  *	- modified Intel Command Set 0x0001 to support ST Advanced Architecture
  *	- modified Intel Command Set 0x0001 to support ST Advanced Architecture
  *	  (command set 0x0020)
  *	  (command set 0x0020)
  *	- added a writev function
  *	- added a writev function
+ * 07/13/2005	Joern Engel <joern@wh.fh-wedel.de>
+ * 	- Plugged memory leak in cfi_staa_writev().
  */
  */
 
 
 #include <linux/version.h>
 #include <linux/version.h>
@@ -719,6 +721,7 @@ cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
 write_error:
 write_error:
 	if (retlen)
 	if (retlen)
 		*retlen = totlen;
 		*retlen = totlen;
+	kfree(buffer);
 	return ret;
 	return ret;
 }
 }