Skip to content

Commit

Permalink
UBI: fix memory leak in update path
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jan 18, 2010
1 parent b531b55 commit ebddd63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/ubi/upd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ebddd63

Please sign in to comment.