[PATCH v1] media: tegra: vi: replace devm_kzalloc with kzalloc in probe

From: Dharanitharan R

Date: Wed Nov 26 2025 - 01:53:11 EST


Replace devm_kzalloc() (line 1881) with kzalloc() in tegra_vi_probe()
since memory must be freed manually in error paths. Freed via kfree() in
rpm_disable, as recommended in the file comment (line 1204).

Signed-off-by: Dharanitharan R <dharanitharan725@xxxxxxxxx>
---
drivers/staging/media/tegra-video/vi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index c9276ff76157..73127ea6ee49 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -1878,7 +1878,7 @@ static int tegra_vi_probe(struct platform_device *pdev)
struct tegra_vi *vi;
int ret;

- vi = devm_kzalloc(&pdev->dev, sizeof(*vi), GFP_KERNEL);
+ vi = kzalloc(sizeof(*vi), GFP_KERNEL);
if (!vi)
return -ENOMEM;

@@ -1941,6 +1941,7 @@ static int tegra_vi_probe(struct platform_device *pdev)
if (vi->ops->vi_enable)
vi->ops->vi_enable(vi, false);
pm_runtime_disable(&pdev->dev);
+ kfree(vi);
return ret;
}

--
2.43.0