Re: [PATCH v2] of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop()

From: Rob Herring
Date: Sun Dec 11 2022 - 20:00:09 EST



On Sun, 11 Dec 2022 10:33:37 +0800, ruanjinjie wrote:
> when kmalloc() fail to allocate memory in kasprintf(), fn_1 or fn_2 will
> be NULL, strcmp() will cause null pointer dereference.
>
> Fixes: 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property")
> Signed-off-by: ruanjinjie <ruanjinjie@xxxxxxxxxx>
> ---
> v2:
> - not care return code, so check whether fn_1 or fn_2 is NULL in assigning node_path_match
> ---
> drivers/of/overlay.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Applied, thanks!