소스 검색

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>
Brian Norris 11 년 전
부모
커밋
36c6a7ac74
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      drivers/mtd/chips/cfi_cmdset_0002.c

+ 2 - 0
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 */