mtd: nand: Fix writing mtdoops to nand flash.
authorBrent Taylor <motobud@gmail.com>
Tue, 31 Oct 2017 03:32:45 +0000 (22:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:40:52 +0000 (08:40 +0000)
commitff342113b7788420ae7da409e59afb8cd206b08d
tree208dcaf05de8ebbfe7e0a16c82005286c8f00f87
parentd54ca1d0ea19feb7aedd256b9f58a7478ef23819
mtd: nand: Fix writing mtdoops to nand flash.

commit 30863e38ebeb500a31cecee8096fb5002677dd9b upstream.

When mtdoops calls mtd_panic_write(), it eventually calls
panic_nand_write() in nand_base.c. In order to properly wait for the
nand chip to be ready in panic_nand_wait(), the chip must first be
selected.

When using the atmel nand flash controller, a panic would occur due to
a NULL pointer exception.

Fixes: 2af7c6539931 ("mtd: Add panic_write for NAND flashes")
Signed-off-by: Brent Taylor <motobud@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/nand_base.c