FAILED: patch "[PATCH] of: resolver: Fix device node refcount leakage in" failed to apply to 6.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.14.y
git checkout FETCH_HEAD
git cherry-pick -x a46a0805635d07de50c2ac71588345323c13b2f9
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025041757-line-backing-3af1@gregkh' --subject-prefix 'PATCH 6.14.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a46a0805635d07de50c2ac71588345323c13b2f9 Mon Sep 17 00:00:00 2001
From: Zijun Hu <[email protected]>
Date: Mon, 24 Feb 2025 17:01:55 -0600
Subject: [PATCH] of: resolver: Fix device node refcount leakage in
of_resolve_phandles()
In of_resolve_phandles(), refcount of device node @local_fixups will be increased if the for_each_child_of_node() exits early, but nowhere to decrease the refcount, so cause refcount leakage for the node.
Fix by using __free() on @local_fixups.
drivers/of/resolver.c +2 -1
@@ -249,8 +249,9 @@ static int adjust_local_phandle_references(const struct device_node *local_fixup*/ int of_resolve_phandles (struct device_node *overlay) { -struct device_node *child, *local_fixups, *refnode; +struct device_node *child, *refnode;struct device_node *overlay_fixups; + struct device_node __free(device_node) *local_fixups = NULL;struct property *prop;const char *refpath;phandle phandle, phandle_delta;