From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D7C124886B for ; Thu, 17 Apr 2025 13:45:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744897526; cv=none; b=UMjiaz749Et/lW7UH7qSTv1FuA5aW52INiuTAdjBPeC/rEw7cLUkD/nkwVGkaCnqpO1qJ0klWp4ekixDJGVqJHetj9C3AAxwXr0bOLYJmEF9g/Rc7mbVRvu1xDG3YuB6Hzll6YJAohc6PWaQHVTbXqTN4NHCkRQfpUaBAdmb6wE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744897526; c=relaxed/simple; bh=Urqc7i2KxI3xkU9jCIbjH6O8/t6byXQPSk2lsfhJplU=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=QvkqZ203DynMP0K5nOmI7/3H1o0V85ykLdN/zzirKIXl0MZxKDvdsiYZ7YlHVHBXtupQ2IXHMTush3cd7fbb5PJdDhvZuKc8MVni5IhDeXmAHtebHF3ohHdeWFMVfP+9cBG2Q3uEI1eQsG4qBF2AQD8r5iZq42SIqXuDSAmHw4Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ek6iaUjg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ek6iaUjg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 765DAC4CEEA; Thu, 17 Apr 2025 13:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744897525; bh=Urqc7i2KxI3xkU9jCIbjH6O8/t6byXQPSk2lsfhJplU=; h=Subject:To:Cc:From:Date:From; b=ek6iaUjgR7f8uwO++Z2Hc9yq4SJTDdzv4CFS/kDkTt7cRbTgTY4pmhy0qYzcLtF5b NH59TrEdQJHPMg+1KlbFSYIahS/Tvew/XhLzB8CuzYs916A/M6yiDx8b9EfuOZ59DG LRrrIcCeJtgzXkb4FmgHMQizwO8j21EoF90ustRY= Subject: FAILED: patch "[PATCH] of: resolver: Fix device node refcount leakage in" failed to apply to 6.14-stable tree To: quic_zijuhu@quicinc.com,robh@kernel.org Cc: From: Date: Thu, 17 Apr 2025 15:42:57 +0200 Message-ID: <2025041757-line-backing-3af1@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The 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 . 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 # git commit -s git send-email --to '' --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 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. Fixes: da56d04c806a ("of/resolver: Switch to new local fixups format.") Cc: stable@vger.kernel.org Signed-off-by: Zijun Hu Link: https://lore.kernel.org/r/20250209-of_irq_fix-v2-9-93e3a2659aa7@quicinc.com [robh: Use __free() instead] Signed-off-by: Rob Herring (Arm) diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index c871e35d4921..2caad365a665 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -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;