* [PATCH] gpu: host1x: mipi: Fix device_node reference leak in tegra_mipi_request()
@ 2026-04-16 12:09 Felix Gu
2026-05-28 13:55 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-04-16 12:09 UTC (permalink / raw)
To: Thierry Reding, Mikko Perttunen, David Airlie, Simona Vetter,
Sowjanya Komatineni
Cc: Thierry Reding, dri-devel, linux-tegra, linux-kernel, Felix Gu
In tegra_mipi_request(), when provider.np is not equal with args.np, it
returns without calling of_node_put(args.np), causing a reference leak.
Convert to use the existing goto out pattern to ensure proper cleanup.
Fixes: 767598d447aa ("gpu: host1x: mipi: Update tegra_mipi_request() to be node based")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/gpu/host1x/mipi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/host1x/mipi.c b/drivers/gpu/host1x/mipi.c
index 01513b775d89..988681423981 100644
--- a/drivers/gpu/host1x/mipi.c
+++ b/drivers/gpu/host1x/mipi.c
@@ -114,8 +114,10 @@ struct tegra_mipi_device *tegra_mipi_request(struct device *device,
if (err < 0)
return ERR_PTR(err);
- if (provider.np != args.np)
- return ERR_PTR(-ENODEV);
+ if (provider.np != args.np) {
+ err = -ENODEV;
+ goto out;
+ }
mipidev = kzalloc_obj(*mipidev);
if (!mipidev) {
---
base-commit: 936c21068d7ade00325e40d82bfd2f3f29d9f659
change-id: 20260416-mipi-8dfb3cc647e4
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpu: host1x: mipi: Fix device_node reference leak in tegra_mipi_request()
2026-04-16 12:09 [PATCH] gpu: host1x: mipi: Fix device_node reference leak in tegra_mipi_request() Felix Gu
@ 2026-05-28 13:55 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2026-05-28 13:55 UTC (permalink / raw)
To: Felix Gu
Cc: Mikko Perttunen, David Airlie, Simona Vetter, Sowjanya Komatineni,
Thierry Reding, dri-devel, linux-tegra, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
On Thu, Apr 16, 2026 at 08:09:29PM +0800, Felix Gu wrote:
> In tegra_mipi_request(), when provider.np is not equal with args.np, it
> returns without calling of_node_put(args.np), causing a reference leak.
>
> Convert to use the existing goto out pattern to ensure proper cleanup.
>
> Fixes: 767598d447aa ("gpu: host1x: mipi: Update tegra_mipi_request() to be node based")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
> drivers/gpu/host1x/mipi.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-28 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 12:09 [PATCH] gpu: host1x: mipi: Fix device_node reference leak in tegra_mipi_request() Felix Gu
2026-05-28 13:55 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox