aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/patches-3.10/0095-mtd-nand-fix-memory-leak-in-ONFI-extended-parameter-.patch
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2014-02-11 02:07:41 +0000
committerLuka Perkov <luka@openwrt.org>2014-02-11 02:07:41 +0000
commit608ad4b6932f72995144bc72a31b1e0843a5bb28 (patch)
tree74954deb17c22532d39672450df39812b548af80 /target/linux/mvebu/patches-3.10/0095-mtd-nand-fix-memory-leak-in-ONFI-extended-parameter-.patch
parenta8c10d8f903682fb3dde82084665a9a72216b02e (diff)
downloadmaster-187ad058-608ad4b6932f72995144bc72a31b1e0843a5bb28.tar.gz
master-187ad058-608ad4b6932f72995144bc72a31b1e0843a5bb28.tar.bz2
master-187ad058-608ad4b6932f72995144bc72a31b1e0843a5bb28.zip
mvebu: backport mainline patches from kernel 3.12
This is a backport of the patches accepted to the Linux mainline related to mvebu SoC (Armada XP and Armada 370) between Linux v3.11, and Linux v3.12. This work mainly covers: * Ground work for sharing the pxa nand driver(drivers/mtd/nand/pxa3xx_nand.c) between the PXA family,and the Armada family. * Further updates to the mvebu MBus. * Work and ground work for enabling MSI on the Armada family. * some phy / mdio bus initialization related work. * Device tree binding documentation update. Signed-off-by: Seif Mazareeb <seif.mazareeb@gmail.com> CC: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39565 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mvebu/patches-3.10/0095-mtd-nand-fix-memory-leak-in-ONFI-extended-parameter-.patch')
-rw-r--r--target/linux/mvebu/patches-3.10/0095-mtd-nand-fix-memory-leak-in-ONFI-extended-parameter-.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-3.10/0095-mtd-nand-fix-memory-leak-in-ONFI-extended-parameter-.patch b/target/linux/mvebu/patches-3.10/0095-mtd-nand-fix-memory-leak-in-ONFI-extended-parameter-.patch
new file mode 100644
index 0000000000..5cb74f974a
--- /dev/null
+++ b/target/linux/mvebu/patches-3.10/0095-mtd-nand-fix-memory-leak-in-ONFI-extended-parameter-.patch
@@ -0,0 +1,51 @@
+From 5d15281ca712cb873835e301937f3a8342e88d4b Mon Sep 17 00:00:00 2001
+From: Brian Norris <computersforpeace@gmail.com>
+Date: Mon, 16 Sep 2013 17:59:20 -0700
+Subject: [PATCH 095/203] mtd: nand: fix memory leak in ONFI extended parameter
+ page
+
+This fixes a memory leak in the ONFI support code for detecting the
+required ECC levels from this commit:
+
+ commit 6dcbe0cdd83fb5f77be4f44c9e06c535281c375a
+ Author: Huang Shijie <b32955@freescale.com>
+ Date: Wed May 22 10:28:27 2013 +0800
+
+ mtd: get the ECC info from the Extended Parameter Page
+
+In the success case, we never freed the 'ep' buffer.
+
+Also, this fixes an oversight in the same commit where we (harmlessly)
+freed the NULL pointer.
+
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Acked-by: Huang Shijie <b32955@freescale.com>
+Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
+---
+ drivers/mtd/nand/nand_base.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+--- a/drivers/mtd/nand/nand_base.c
++++ b/drivers/mtd/nand/nand_base.c
+@@ -2862,10 +2862,8 @@ static int nand_flash_detect_ext_param_p
+
+ len = le16_to_cpu(p->ext_param_page_length) * 16;
+ ep = kmalloc(len, GFP_KERNEL);
+- if (!ep) {
+- ret = -ENOMEM;
+- goto ext_out;
+- }
++ if (!ep)
++ return -ENOMEM;
+
+ /* Send our own NAND_CMD_PARAM. */
+ chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
+@@ -2913,7 +2911,7 @@ static int nand_flash_detect_ext_param_p
+ }
+
+ pr_info("ONFI extended param page detected.\n");
+- return 0;
++ ret = 0;
+
+ ext_out:
+ kfree(ep);