From patchwork Wed Mar 16 12:34:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongfeng Wang X-Patchwork-Id: 552080 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0215C433EF for ; Wed, 16 Mar 2022 12:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348295AbiCPMVy (ORCPT ); Wed, 16 Mar 2022 08:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbiCPMVx (ORCPT ); Wed, 16 Mar 2022 08:21:53 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95A94606FF; Wed, 16 Mar 2022 05:20:38 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KJTph4kPKzfYnN; Wed, 16 Mar 2022 20:19:08 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 16 Mar 2022 20:20:36 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 16 Mar 2022 20:20:36 +0800 From: Xiongfeng Wang To: , , , CC: , , , Subject: [PATCH -next] media: mtk-vcodec: Add missing of_node_put() in mtk_vdec_hw_prob_done() Date: Wed, 16 Mar 2022 20:34:52 +0800 Message-ID: <20220316123452.186166-1-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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);