[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250121-nuvoton-v1-2-1ea4f0cdbda2@chromium.org>
Date: Tue, 21 Jan 2025 21:14:51 +0000
From: Ricardo Ribalda <ribalda@...omium.org>
To: Joseph Liu <kwliu@...oton.com>, Marvin Lin <kflin@...oton.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil@...all.nl>, Philipp Zabel <p.zabel@...gutronix.de>
Cc: Marvin Lin <milkfafa@...il.com>, linux-media@...r.kernel.org,
openbmc@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Ricardo Ribalda <ribalda@...omium.org>, stable@...r.kernel.org
Subject: [PATCH 2/4] media: nuvoton: Fix reference handling of ece_node
Make sure all the code paths call of_node_put().
Cc: stable@...r.kernel.org
Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and encoding engine")
Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
---
drivers/media/platform/nuvoton/npcm-video.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c
index 7b4c23dbe709..f6cba17a7924 100644
--- a/drivers/media/platform/nuvoton/npcm-video.c
+++ b/drivers/media/platform/nuvoton/npcm-video.c
@@ -1665,11 +1665,11 @@ static int npcm_video_ece_init(struct npcm_video *video)
dev_info(dev, "Support HEXTILE pixel format\n");
ece_pdev = of_find_device_by_node(ece_node);
+ of_node_put(ece_node);
if (!ece_pdev) {
dev_err(dev, "Failed to find ECE device\n");
return -ENODEV;
}
- of_node_put(ece_node);
regs = devm_platform_ioremap_resource(ece_pdev, 0);
if (IS_ERR(regs)) {
@@ -1692,6 +1692,8 @@ static int npcm_video_ece_init(struct npcm_video *video)
dev_err(dev, "Failed to get ECE reset control in DTS\n");
return PTR_ERR(video->ece.reset);
}
+ } else {
+ of_node_put(ece_node);
}
return 0;
--
2.48.0.rc2.279.g1de40edade-goog
Powered by blists - more mailing lists