lkml.org 
[lkml]   [2022]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] media: mtk-vcodec: Add missing of_node_put() in mtk_vdec_hw_prob_done()
Date
of_find_compatible_node() will increment the refcount of the returned
device_node. Calling of_node_put() to avoid the refcount leak.

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
index 8d2a641d92f1..60da59611434 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
@@ -47,6 +47,8 @@ static int mtk_vdec_hw_prob_done(struct mtk_vcodec_dev *vdec_dev)
if (!subdev_node)
continue;

+ of_node_put(subdev_node);
+
hw_idx = (enum mtk_vdec_hw_id)(uintptr_t)of_id->data;
if (!test_bit(hw_idx, vdec_dev->subdev_bitmap)) {
dev_err(&pdev->dev, "vdec %d is not ready", hw_idx);
--
2.20.1
\
 
 \ /
  Last update: 2022-03-16 13:21    [W:0.031 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site