UBI: Fix stale pointers in ubi->lookuptbl
authorRichard Weinberger <richard@nod.at>
Mon, 10 Nov 2014 15:16:23 +0000 (16:16 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 26 Mar 2015 21:46:04 +0000 (22:46 +0100)
In some error paths the WL sub-system gives up on a PEB
and frees it's ubi_wl_entry struct but does not set
the entry in ubi->lookuptbl to NULL.
Fastmap can stumble over such a stale pointer as it uses
ubi->lookuptbl to find all PEBs.

Fix this by introducing a new helper function which free()s
a WL entry and removes the reference from the lookup table.

Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/wl.c

Simple merge