From: Joakim Tjernlund Date: Mon, 7 Feb 2011 16:07:11 +0000 (+0100) Subject: mtd: fix race in cfi_cmdset_0001 driver X-Git-Tag: v2.6.38~16^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecf3fde07c8dcb92a1bf3fbdfe70905d85cd00e1;p=pandora-kernel.git mtd: fix race in cfi_cmdset_0001 driver As inval_cache_and_wait_for_operation() drop and reclaim the lock to invalidate the cache, some other thread may suspend the operation before reaching the for(;;) loop. Therefore the loop must start with checking the chip->state before reading status from the chip. Signed-off-by: Joakim Tjernlund Acked-by: Michael Cashwell Acked-by: Stefan Bigler Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Cc: stable@kernel.org --- Reading git-diff-tree failed