]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: intel: fix possible null-ptr-deref in ebu_nand_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 26 Apr 2022 08:49:12 +0000 (16:49 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 27 Apr 2022 15:15:07 +0000 (17:15 +0200)
commit7c3c9a0933665cbab695e9cdd644a29ab5ec393f
tree40b32d679f783750cd42d150186704fc46059567
parentab4948dfb7259f461e8c7ee7caa650371b912117
mtd: rawnand: intel: fix possible null-ptr-deref in ebu_nand_probe()

It will cause null-ptr-deref when using 'res', if platform_get_resource()
returns NULL, so move using 'res' after devm_ioremap_resource() that
will check it to avoid null-ptr-deref.

Fixes: 3f65cf4d8461 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220426084913.4021868-2-yangyingliang@huawei.com
drivers/mtd/nand/raw/intel-nand-controller.c