From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796220827; b=admVgsutSzKj+wKmaExzaJZgUZ0eiSwLB6GdzKcTDQUtNkOaWllgV7oGVfjWC6InO0+g 4/kHSzbQlcQ0gGr0SagWmUIpOsAIF8eV6fqEGh4lY/nTgHmn59vF/xCmCmEhG7TWoSgxd HTHgRdiTGlS0BoScHCmiJ+iSEkvEyz/l/9U/2ywMSH4YfNQjfkGMQWf/8diL3D5C1qCLO 8zHIUMT14p0iB+e7dA7u2csH6SYTK+egl7hvb15teXiFajEpyqycwmq3xMCKsg9N5siXr pgDEsUtpoVpVLlLk8Ebx10LpXfBWPFCV+csYvltMB3TXLszkEUVIooph5cmySqlyvGQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220827; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=K2rr8ET2T5lcNDhCd72Z1jNB1horUEqnil/W16lguts=; b=ZtJ7JeQvvi3yHPO/G9qMHm3Q3scLhOLk7NovACHIJ2rY5Fky2s1ohaJ/MJjmbl4IRMIg plQZIe6gwu7LK0PAfGK3p2tnMDug1+sifD/cqPxLn2Vpwtu6suiAj5vUw3BpwLi8NTXNM Nlpcn2QrT2N0/VRncT7V/zFCIDCtBJCsk/WMGXsO0c5KJ+k1SdfrzWcbdfhX3MmYrJYZP CNx6aTELcge72ceyWX14LvZYV8QWaZKVR65uR4dGjkwSok05HG/upXu5iWrizYc0YveTP VXu6Vcen6blqJlHhrNA7DV+khYdkrkhNq0tNSvvrh1OV6outqy7qvJxoULOMLKQgsvA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Gu4Z0+8r; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D20C606A322 for ; Wed, 2 Dec 2026 14:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Gu4Z0+8r Received: by smtp.kernel.org (Postfix) with ESMTPSA id 533131F0089A; Wed, 2 Dec 2026 14:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796220826; bh=K2rr8ET2T5lcNDhCd72Z1jNB1horUEqnil/W16lguts=; h=Subject:To:Cc:From:Date; b=Gu4Z0+8rRF+UnsgdLEN9NdMOYkwgDCHEMJhORong9CnZ+wZD1lCcuVV704FXAJHlt JB+CA9nWT+wzHzdoz6a8Er7pi6WgilXNasfRNbZ24t4UNx0/+jnVb0Vl0UuPgqhFuY OH9w+4JHU+DASaye20y44NNOX9aVHUF+WMAT+bpM= Subject: FAILED: patch "[PATCH] drm/vc4: Fix firmware reference leak in vc4_hvs_bind()" failed to apply to 6.6-stable tree To: vulab@iscas.ac.cn,mcanal@igalia.com Cc: From: Date: Wed, 02 Dec 2026 13:41:59 +0100 Message-ID: <2026120259-onboard-version-d1e8@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-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.6.y git checkout FETCH_HEAD git cherry-pick -x af200e91c7b996177aa90981b2f0e794b085d43a # git commit -s git send-email --to '' --in-reply-to '2026120259-onboard-version-d1e8@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From af200e91c7b996177aa90981b2f0e794b085d43a Mon Sep 17 00:00:00 2001 From: Wentao Liang Date: Fri, 6 Nov 2026 09:20:16 +0000 Subject: [PATCH] drm/vc4: Fix firmware reference leak in vc4_hvs_bind() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The firmware reference taken via rpi_firmware_get() is leaked when either of the devm_clk_get() calls for the core or display clocks fails, as both error paths return without releasing it. Fix it by moving the firmware lookup below the clock lookups, so that the reference is taken right before the firmware property is read and released immediately afterwards. The rpi_firmware_find_node() call moves with it: the device node reference it returns would otherwise be leaked by those same error paths. The candidate was found by our static analysis tooling, and this change was prepared with assistance from DeepSeek-V4.1-Flash and GPT-6.1-Sol. Fixes: 2a001ca00ad5 ("drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection code") Cc: stable@vger.kernel.org Suggested-by: Maíra Canal Signed-off-by: Wentao Liang Link: https://patch.msgid.link/20261106092016.2282805-1-vulab@iscas.ac.cn Signed-off-by: Maíra Canal diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index b1fb096858cc..537aaa992129 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -1677,15 +1677,6 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) struct device_node *node; unsigned int max_rate; - node = rpi_firmware_find_node(); - if (!node) - return -EINVAL; - - firmware = rpi_firmware_get(node); - of_node_put(node); - if (!firmware) - return -EPROBE_DEFER; - hvs->core_clk = devm_clk_get(&pdev->dev, (vc4->gen >= VC4_GEN_6_C) ? "core" : NULL); if (IS_ERR(hvs->core_clk)) { @@ -1700,6 +1691,15 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) return PTR_ERR(hvs->disp_clk); } + node = rpi_firmware_find_node(); + if (!node) + return -EINVAL; + + firmware = rpi_firmware_get(node); + of_node_put(node); + if (!firmware) + return -EPROBE_DEFER; + max_rate = rpi_firmware_clk_get_max_rate(firmware, RPI_FIRMWARE_CORE_CLK_ID); rpi_firmware_put(firmware);