UBI: Fix double free after do_sync_erase()
authorRichard Weinberger <richard@nod.at>
Thu, 6 Nov 2014 15:47:49 +0000 (16:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2015 14:59:01 +0000 (06:59 -0800)
commitccebbb7e53c8d028961340d3081d69658f8a5bef
tree6b29d3347616038968660dba9c702f24d3164c8b
parent398dd8fd97a3cf7777c5ee0fb1b52b8ec2edf9b8
UBI: Fix double free after do_sync_erase()

commit aa5ad3b6eb8feb2399a5d26c8fb0060561bb9534 upstream.

If the erase worker is unable to erase a PEB it will
free the ubi_wl_entry itself.
The failing ubi_wl_entry must not free()'d again after
do_sync_erase() returns.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/ubi/wl.c