Commit 0dc3c353 authored by davidcunado-arm's avatar davidcunado-arm Committed by GitHub
Browse files

Merge pull request #984 from masahir0y/uniphier

uniphier memory-overrun bug fix
parents 3b6947ec 3eba78d3
......@@ -106,8 +106,9 @@ static int uniphier_nand_block_isbad(struct uniphier_nand *nand, int block)
is_bad = bbm != 0xff;
/* save the result for future re-use */
nand->bbt[block] = is_bad;
/* if possible, save the result for future re-use */
if (block < ARRAY_SIZE(nand->bbt))
nand->bbt[block] = is_bad;
if (is_bad)
WARN("found bad block at %d. skip.\n", block);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment