UBI: Fix PEB leak in wear_leveling_worker()
get_peb_for_wl() removes the PEB from the free list.
If the WL subsystem detects that no wear leveling is needed
it cancels the operation and drops the gained PEB.
In this case we have to put the PEB back into the free list.

This issue was introduced with commit ed4b7021c
(UBI: remove PEB from free tree in get_peb_for_wl()).

Cc: <stable@vger.kernel.org> # 3.7.x
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
1 parent 0cff096 commit 92924e7ae171609a748df38ce91763cc3e05bfa7
@Richard Weinberger Richard Weinberger authored on 19 Aug 2013
Sascha Hauer committed on 7 Jan 2014
Showing 1 changed file
View
drivers/mtd/ubi/wl.c