diff options
author | Brian Norris <computersforpeace@gmail.com> | 2014-07-22 04:06:19 +0200 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-08-19 20:53:07 +0200 |
commit | 36c6a7ac74044b8025488c018279115bb3c32eb0 (patch) | |
tree | 7200d0b6be6b78595dff1fff8520ffb52190c636 /drivers/mtd/chips | |
parent | mtd: nand: fix nand_lock/unlock() function (diff) | |
download | linux-36c6a7ac74044b8025488c018279115bb3c32eb0.tar.xz linux-36c6a7ac74044b8025488c018279115bb3c32eb0.zip |
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@gmail.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 5a4bfe33112a..6da141af9cba 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 */ |