Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: rawnand: tmio: check return value after calling platform_get_resource()

It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.

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-3-yangyingliang@huawei.com

authored by

Yang Yingliang and committed by
Miquel Raynal
9b2152f9 ddf66aef

+3
+3
drivers/mtd/nand/raw/tmio_nand.c
··· 390 390 if (data == NULL) 391 391 dev_warn(&dev->dev, "NULL platform data!\n"); 392 392 393 + if (!ccr || !fcr) 394 + return -EINVAL; 395 + 393 396 tmio = devm_kzalloc(&dev->dev, sizeof(*tmio), GFP_KERNEL); 394 397 if (!tmio) 395 398 return -ENOMEM;