浏览代码

mtd: nand: max_retries off by one in mxc_nand

with `while (max_retries-- > 0)' max_retries reaches -1 after the loop.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Roel Kluin 16 年之前
父节点
当前提交
43950a605d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mtd/nand/mxc_nand.c

+ 1 - 1
drivers/mtd/nand/mxc_nand.c

@@ -199,7 +199,7 @@ static void wait_op_done(struct mxc_nand_host *host, int max_retries,
 			}
 			}
 			udelay(1);
 			udelay(1);
 		}
 		}
-		if (max_retries <= 0)
+		if (max_retries < 0)
 			DEBUG(MTD_DEBUG_LEVEL0, "%s(%d): INT not set\n",
 			DEBUG(MTD_DEBUG_LEVEL0, "%s(%d): INT not set\n",
 			      __func__, param);
 			      __func__, param);
 	}
 	}