FAILED: patch "[PATCH] drm/vc4: Fix firmware reference leak in vc4_drm_bind()" failed to apply to 6.12-stable tree
Subsystems (4)
[email protected]
maintainerThe 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 <[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.12.y
git checkout FETCH_HEAD
git cherry-pick -x b816da5d5df1461446a0a5f3fe2b4948a659a790
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026101258-emporium-attempt-639f@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b816da5d5df1461446a0a5f3fe2b4948a659a790 Mon Sep 17 00:00:00 2001
From: Wentao Liang <[email protected]>
Date: Wed, 16 Sep 2026 15:40:15 +0000
Subject: [PATCH] drm/vc4: Fix firmware reference leak in vc4_drm_bind()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The firmware reference obtained via rpi_firmware_get() is leaked when aperture_remove_all_conflicting_devices() fails, as the error label returns without putting it. This happens before the firmware is consumed and put further down in the function.
Put the firmware reference before jumping to err.
drivers/gpu/drm/vc4/vc4_drv.c +4 -1
@@ -360,8 +360,11 @@ static int vc4_drm_bind(struct device *dev) } ret =aperture_remove_all_conflicting_devices (driver->name); -if (ret) +if (ret) { +if (firmware) +rpi_firmware_put (firmware); goto err; + }if (firmware) { ret = rpi_firmware_property(firmware,
Sasha Levin
maintainerPATCH 1/2 drm/vc4: Use video aperture helpers
From: Thomas Zimmermann <[email protected]>
[ Upstream commit 7e89e4365fd36ca006670788ec2c1527bfd0c61c ]
DRM's aperture functions have long been implemented as helpers under drivers/video/ for use with fbdev. Avoid the DRM wrappers by calling the video functions directly.
Stable-dep-of: b816da5d5df1 ("drm/vc4: Fix firmware reference leak in vc4_drm_bind()")
--- drivers/gpu/drm/vc4/vc4_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +2 -2
@@ -20,6 +20,7 @@* driver. */ +#include <linux/aperture.h> #include <linux/clk.h> #include <linux/component.h> #include <linux/device.h>
@@ -30,7 +31,6 @@#include <linux/platform_device.h> #include <linux/pm_runtime.h> -#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -356,7 +356,7 @@ static int vc4_drm_bind(struct device *dev) } } - ret =drm_aperture_remove_framebuffers (driver); + ret =aperture_remove_all_conflicting_devices (driver->name);if (ret) goto err;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 drm/vc4: Fix firmware reference leak in vc4_drm_bind()
From: Wentao Liang <[email protected]>
[ Upstream commit b816da5d5df1461446a0a5f3fe2b4948a659a790 ]
The firmware reference obtained via rpi_firmware_get() is leaked when aperture_remove_all_conflicting_devices() fails, as the error label returns without putting it. This happens before the firmware is consumed and put further down in the function.
Put the firmware reference before jumping to err.
--- drivers/gpu/drm/vc4/vc4_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vc4/vc4_drv.c +4 -1
@@ -357,8 +357,11 @@ static int vc4_drm_bind(struct device *dev) } ret =aperture_remove_all_conflicting_devices (driver->name); -if (ret) +if (ret) { +if (firmware) +rpi_firmware_put (firmware); goto err; + }if (firmware) { ret = rpi_firmware_property(firmware,
Signature · 1 line
2.53.0