aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-01-18 09:43:44 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-01-18 11:53:56 -0500
commitebddd63b74dcf1cb676d14328d5852f1fee19a8a (patch)
treec924535e6ae791d514ec809c99ebb214d66d97b7 /drivers/mtd
parentb531b55a7bde8aa2bdf7023b3afc6df1bf3dcb67 (diff)
UBI: fix memory leak in update path
When truncating an UBI volume, UBI should allocates a PEB-sized buffer but does not release it, which leads to memory leaks. This patch fixes the issue. Reported-by: Marek Skuczynski <mareksk7@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Tested-by: Marek Skuczynski <mareksk7@gmail.com> Cc: stable@kernel.org
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/upd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
index c1d7b880c795..425bf5a3edd4 100644
--- a/drivers/mtd/ubi/upd.c
+++ b/drivers/mtd/ubi/upd.c
@@ -155,6 +155,7 @@ int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol,
155 if (err) 155 if (err)
156 return err; 156 return err;
157 vol->updating = 0; 157 vol->updating = 0;
158 return 0;
158 } 159 }
159 160
160 vol->upd_buf = vmalloc(ubi->leb_size); 161 vol->upd_buf = vmalloc(ubi->leb_size);