Commit 630ed84e authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Jiri Slaby

mtd: onenand: fix deadlock in onenand_block_markbad

commit 5e64c29e upstream.

Commit 5942ddbc ("mtd: introduce mtd_block_markbad interface")
incorrectly changed onenand_block_markbad() to call mtd_block_markbad
instead of onenand_chip's block_markbad function. As a result the function
will now recurse and deadlock. Fix by reverting the change.

Fixes: 5942ddbc ("mtd: introduce mtd_block_markbad interface")
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 71e64a84
...@@ -2610,6 +2610,7 @@ static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) ...@@ -2610,6 +2610,7 @@ static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
*/ */
static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs) static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
{ {
struct onenand_chip *this = mtd->priv;
int ret; int ret;
ret = onenand_block_isbad(mtd, ofs); ret = onenand_block_isbad(mtd, ofs);
...@@ -2621,7 +2622,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs) ...@@ -2621,7 +2622,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
} }
onenand_get_device(mtd, FL_WRITING); onenand_get_device(mtd, FL_WRITING);
ret = mtd_block_markbad(mtd, ofs); ret = this->block_markbad(mtd, ofs);
onenand_release_device(mtd); onenand_release_device(mtd);
return ret; return ret;
} }
......
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