Skip to content

Commit

Permalink
mtd: onenand: fix deadlock in onenand_block_markbad
Browse files Browse the repository at this point in the history
commit 5e64c29 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>
  • Loading branch information
Aaro Koskinen authored and Greg Kroah-Hartman committed Apr 12, 2016
1 parent babcedf commit ee7f329
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,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)
{
struct onenand_chip *this = mtd->priv;
int ret;

ret = onenand_block_isbad(mtd, ofs);
Expand All @@ -2617,7 +2618,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
}

onenand_get_device(mtd, FL_WRITING);
ret = mtd_block_markbad(mtd, ofs);
ret = this->block_markbad(mtd, ofs);
onenand_release_device(mtd);
return ret;
}
Expand Down

0 comments on commit ee7f329

Please sign in to comment.