Skip to content
Commit a28ed09d authored by Yang Yingliang's avatar Yang Yingliang Committed by Miquel Raynal
Browse files

mtd: rawnand: cadence: fix possible null-ptr-deref in cadence_nand_dt_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.
And use devm_platform_get_and_ioremap_resource() to simplify code.

Fixes: ec4ba01e ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220426084913.4021868-1-yangyingliang@huawei.com
parent 3380557f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment