From: "Rob Herring (Arm)" <robh@kernel.org>
To: Tuo Li <islituo@gmail.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
saravanak@google.com
Subject: Re: [PATCH] of: unittest: fix possible null-pointer dereferences in of_unittest_property_copy()
Date: Mon, 5 Jan 2026 16:11:53 -0600 [thread overview]
Message-ID: <176765111114.3559000.3639451594836452599.robh@kernel.org> (raw)
In-Reply-To: <20260105071438.156186-1-islituo@gmail.com>
On Mon, 05 Jan 2026 15:14:38 +0800, Tuo Li wrote:
> This function first duplicates p1 and p2 into new, and then checks whether
> the duplication succeeds. However, if the duplication fails (e.g.,
> kzalloc() returns NULL in __of_prop_dup()), new will be NULL but is still
> dereferenced in __of_prop_free(). To ensure that the unit test continues to
> run even when duplication fails, add a NULL check before calling
> __of_prop_free().
>
> Fixes: 1c5e3d9bf33b ("of: Add a helper to free property struct")
> Signed-off-by: Tuo Li <islituo@gmail.com>
> ---
> drivers/of/unittest.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
Applied, thanks!
prev parent reply other threads:[~2026-01-05 22:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-05 7:14 Tuo Li
2026-01-05 22:11 ` Rob Herring (Arm) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176765111114.3559000.3639451594836452599.robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=islituo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=saravanak@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®