Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebddd63b authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

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: default avatarMarek Skuczynski <mareksk7@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tested-by: default avatarMarek Skuczynski <mareksk7@gmail.com>
Cc: stable@kernel.org
parent b531b55a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);