Skip to content

Commit ded1db9

Browse files
aakoskingregkh
authored andcommitted
mtd: onenand: fix deadlock in onenand_block_markbad
commit 5e64c29e98bfbba1b527b0a164f9493f3db9e8cb upstream. Commit 5942ddb ("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: 5942ddb ("mtd: introduce mtd_block_markbad interface") Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5dc7e93 commit ded1db9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mtd/onenand/onenand_base.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2599,6 +2599,7 @@ static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
25992599
*/
26002600
static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
26012601
{
2602+
struct onenand_chip *this = mtd->priv;
26022603
int ret;
26032604

26042605
ret = onenand_block_isbad(mtd, ofs);
@@ -2610,7 +2611,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
26102611
}
26112612

26122613
onenand_get_device(mtd, FL_WRITING);
2613-
ret = mtd_block_markbad(mtd, ofs);
2614+
ret = this->block_markbad(mtd, ofs);
26142615
onenand_release_device(mtd);
26152616
return ret;
26162617
}

0 commit comments

Comments
 (0)