]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: physmap-core: Fix NULL pointer dereferencing in of_select_probe_type()
authorZeng Jingxiang <linuszeng@tencent.com>
Wed, 27 Jul 2022 06:03:02 +0000 (14:03 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 19 Sep 2022 16:14:53 +0000 (18:14 +0200)
commit23e7d2e5b27d51e72bdc6f47d41bfd1bb2ad0a57
tree14cdf56ae7c23daa906139e4e4fa0e0cc01cc94a
parent5d07d8eaf37218116c38005628f9ba16cb59c030
mtd: physmap-core: Fix NULL pointer dereferencing in of_select_probe_type()

Coverity complains of a possible NULL dereference:

in of_select_probe_type():
1. returned_null: of_match_device() returns NULL.
2. var_assigned: match = NULL return value from of_match_device()
309 match = of_match_device(of_flash_match, &dev->dev);

3.dereference: Dereferencing the NULL pointer match.
310 probe_type = match->data;

Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220727060302.1560325-1-zengjx95@gmail.com
drivers/mtd/maps/physmap-core.c