mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
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
This commit is contained in:
parent
b531b55a7b
commit
ebddd63b74
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue