From: Richard Weinberger Date: Fri, 19 Sep 2014 15:37:56 +0000 (+0200) Subject: UBI: Fix livelock in produce_free_peb() X-Git-Tag: omap-for-v3.19/prcm-cleanup~74^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b91671bb23a79c32a23b0ad5d6e6ad292bb21bdf;p=pandora-kernel.git UBI: Fix livelock in produce_free_peb() The while loop in produce_free_peb() assumes that each work will produce a free PEB. This is not true. If ubi->works_count is 1 and the only scheduled work is the wear_leveling_worker() produce_free_peb() can loop forever in case nobody schedules an erase work. Fix this issue by checking in the while loop whether work is scheduled. Signed-off-by: Richard Weinberger Signed-off-by: Artem Bityutskiy --- Reading git-diff-tree failed