summaryrefslogtreecommitdiff
path: root/include/linux/i2c/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorTuo Li <islituo@gmail.com>2026-01-05 15:14:38 +0800
committerRob Herring (Arm) <robh@kernel.org>2026-02-03 20:58:10 -0600
commitd289cb7fcefe41a54d8f9c6d0e0947f5f82b15c6 (patch)
treef7e2dc02cb510175a17a2bf4764c58b670f9229c /include/linux/i2c/git@git.tavy.me:linux.git
parent5872df37c4ade93df81dd46020eef0e254cf7fb7 (diff)
of: unittest: fix possible null-pointer dereferences in of_unittest_property_copy()
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> Link: https://patch.msgid.link/20260105071438.156186-1-islituo@gmail.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'include/linux/i2c/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions