linux-stable/drivers/mtd
Johan Hovold 0aa6b111cc mtd: rawnand: atmel: fix OF child-node lookup
commit 5d1e9c2212 upstream.

Use the new of_get_compatible_child() helper to lookup the nfc child
node instead of using of_find_compatible_node(), which searches the
entire tree from a given start node and thus can return an unrelated
(i.e. non-child) node.

This also addresses a potential use-after-free (e.g. after probe
deferral) as the tree-wide helper drops a reference to its first
argument (i.e. the node of the device being probed).

While at it, also fix a related nfc-node reference leak.

Fixes: f88fc122cc ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: stable <stable@vger.kernel.org>     # 4.11
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Josh Wu <rainyfeeling@outlook.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-01 09:42:55 +01:00
..
chips mtd: cfi_cmdset_0002: Change erase functions to check chip good only 2018-07-11 16:29:23 +02:00
devices mtd: docg3: don't set conflicting BCH_CONST_PARAMS option 2018-11-21 09:24:09 +01:00
lpddr
maps mtd/maps: fix solutionengine.c printk format warnings 2018-09-26 08:38:00 +02:00
nand mtd: rawnand: atmel: fix OF child-node lookup 2018-12-01 09:42:55 +01:00
onenand
parsers
spi-nor mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB 2018-11-13 11:14:45 -08:00
tests mtd: mtd_oobtest: Handle bitflips during reads 2018-04-12 12:32:20 +02:00
ubi mtd: ubi: wl: Fix error return code in ubi_wl_init() 2018-09-19 22:43:48 +02:00
afs.c
ar7part.c
bcm47xxpart.c
bcm63xxpart.c
cmdlinepart.c
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c mtdchar: fix overflows in adjustment of count 2018-09-26 08:38:09 +02:00
mtdconcat.c
mtdcore.c
mtdcore.h
mtdoops.c
mtdpart.c
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
ofpart.c
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c