[PATCH] UBI: Fix invalid vfree()

Artem Bityutskiy dedekind1 at gmail.com
Fri Nov 7 05:15:23 PST 2014


On Mon, 2014-10-27 at 00:46 +0100, Richard Weinberger wrote:
> The logic of vfree()'ing vol->upd_buf is tied to vol->updating.
> In ubi_start_update() vol->updating is set long before vmalloc()'ing
> vol->upd_buf. If we encounter a write failure in ubi_start_update()
> before vmalloc() the UBI device release function will try to vfree()
> vol->upd_buf because vol->updating is set.
> Fix this by allocating vol->upd_buf directly after setting vol->updating.

Pushed, thanks!




More information about the linux-mtd mailing list