Commit a28ed09
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: ec4ba01 ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
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-1-yangyingliang@huawei.com1 parent 3380557 commit a28ed09
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2983 | 2983 | | |
2984 | 2984 | | |
2985 | 2985 | | |
2986 | | - | |
2987 | | - | |
2988 | | - | |
| 2986 | + | |
2989 | 2987 | | |
2990 | 2988 | | |
| 2989 | + | |
2991 | 2990 | | |
2992 | 2991 | | |
2993 | 2992 | | |
| |||
0 commit comments