diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-01-18 16:43:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-28 15:02:31 -0800 |
commit | f6fbe0baa35fd65a4344a48ebc60c08f18a0fc20 (patch) | |
tree | b1e09ede8392e99853f4f8b62046ebb3e1380779 /drivers | |
parent | 4d845d60ad3d385c43716c50fc7c87dd5d3466fe (diff) |
UBI: fix memory leak in update path
commit ebddd63b74dcf1cb676d14328d5852f1fee19a8a upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/ubi/upd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c index c1d7b880c79..425bf5a3edd 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, if (err) return err; vol->updating = 0; + return 0; } vol->upd_buf = vmalloc(ubi->leb_size); |