diff options
| author | Felix Gu <ustc.gu@gmail.com> | 2026-04-16 15:09:29 +0300 |
|---|---|---|
| committer | Thierry Reding <treding@nvidia.com> | 2026-05-28 18:19:29 +0300 |
| commit | b217fb77ca4fd0cc267329500b291c0ad8f8b211 (patch) | |
| tree | 78db2cbd04a45ecbec53d430578b6ec6f9e69d5f | |
| parent | edb4f5e630d9555461a48db89b4a20d5b7e160bb (diff) | |
| download | linux-b217fb77ca4fd0cc267329500b291c0ad8f8b211.tar.xz | |
gpu: host1x: mipi: Fix device_node reference leak in tegra_mipi_request()
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>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260416-mipi-v1-1-9c027175abdf@gmail.com
| -rw-r--r-- | drivers/gpu/host1x/mipi.c | 6 |
1 files 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) { |
