Re: [PATCH] mtd: physmap-core: Fix NULL pointer dereferencing in of_select_probe_type()

From: Miquel Raynal
Date: Mon Sep 19 2022 - 12:16:29 EST


On Wed, 2022-07-27 at 06:03:02 UTC, Zeng Jingxiang wrote:
> From: Zeng Jingxiang <linuszeng@xxxxxxxxxxx>
>
> 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@xxxxxxxxxxx>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel