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 7C43E22422B for ; Thu, 17 Apr 2025 13:45:32 +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=1744897532; cv=none; b=CUaeIfNWTFHHntYVFaChU0jFwIKinbQS3iI6aALzSxhYn904JekpjFPJ+eucNk94ZoDUE3hTLKgTSp12Ew2Xqg7Dlx0gK85+m5AAsRcinp2IbfERg3jkGCglJN9dLcOqlRKIjIC7nBNWggSri2RFBi2ZPMiTVwsnk+GYYCYwp14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744897532; c=relaxed/simple; bh=syswnSTKxW+ky8Iig4pwms9fbQ8cj3cibGUpL4VSIgc=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=qg0bV/UtRARlXZ6hMwAGzu9fOiPJXJj3ForYGqX6Zslmq2p63wFIkdajp/2uR0EfNMWnYQiZJOIWV+Dl/TTU6s5DwVMRwYYgfC2Z23dzXjW9TR7zq1odUu6yiswfYBRHb4GO/j7WUcrz3Q8dONTN/jyKovlPOCpVxJNgp7+ZR2A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FUwm/rS+; 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="FUwm/rS+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C489C4CEEA; Thu, 17 Apr 2025 13:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744897532; bh=syswnSTKxW+ky8Iig4pwms9fbQ8cj3cibGUpL4VSIgc=; h=Subject:To:Cc:From:Date:From; b=FUwm/rS+em94iwiNezum9F/Dv2DTfEy5YHHEolj6jdlLM5I8crd4n25Acv5burYnW ueE2DDvlozTGAo8jsIVRwRFJ29nhgGrquyflMN/oO2FA9magG35SUZ5jt1PiTJrq0o 8iJnPCabDo4mz7Nw0KGMPcxyLUfJbGW+/qSefnj0= Subject: FAILED: patch "[PATCH] of: resolver: Fix device node refcount leakage in" failed to apply to 6.12-stable tree To: quic_zijuhu@quicinc.com,robh@kernel.org Cc: From: Date: Thu, 17 Apr 2025 15:42:58 +0200 Message-ID: <2025041758-unhinge-scolding-c365@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.12-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.12.y git checkout FETCH_HEAD git cherry-pick -x a46a0805635d07de50c2ac71588345323c13b2f9 # git commit -s git send-email --to '' --in-reply-to '2025041758-unhinge-scolding-c365@gregkh' --subject-prefix 'PATCH 6.12.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;