mtd: cfi_cmdset_0002: allow retry/timeout loop to exit
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Wed Oct 15 23:59:02 PDT 2014
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=36c6a7ac74044b8025488c018279115bb3c32eb0
Commit: 36c6a7ac74044b8025488c018279115bb3c32eb0
Parent: 57d3a9a89a0645f3597561e214f8d6852a2c56b4
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Mon Jul 21 19:06:19 2014 -0700
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Aug 19 11:53:07 2014 -0700
mtd: cfi_cmdset_0002: allow retry/timeout loop to exit
The variable 'retries' is never modified, so if the reset operation
never is going to complete, we'll get stuck in an infinite loop.
It looks like the intention was to decrement 'retries' on every loop.
Untested.
Caught by Coverity.
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 5a4bfe3..6da141a 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -2029,6 +2029,8 @@ static int cfi_amdstd_panic_wait(struct map_info *map, struct flchip *chip,
udelay(1);
}
+
+ retries--;
}
/* the chip never became ready */
More information about the linux-mtd-cvs
mailing list