Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp673315rwb; Fri, 18 Nov 2022 06:54:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VIkhX2KwUikUWue2cfkM1o426nUCMkO5ya0lWsTbxLWodw6fIzrAMPyCVHqbOHpbpK7l7 X-Received: by 2002:a50:cd59:0:b0:469:87d:e71e with SMTP id d25-20020a50cd59000000b00469087de71emr3080768edj.242.1668783244371; Fri, 18 Nov 2022 06:54:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783244; cv=none; d=google.com; s=arc-20160816; b=wdh7ns3MRISqPhCD+VukLDANd2NEUyXrOH31vo+3nSUDmmdTDB8ZFWqn/CnfXfpTLA zXBf2X4nRVukejF2fdQSfINk5r+5PD9k7lI3WWeedGngxGtCBdHy+dSWTX7scAhqwaGg NcMOF6gDId+2y7X4+jQscAcuJyasfD7Tp03sxHuZuhlcq208B7DwpImQvInnwhLgFtEz fZLryNktpwtyGxBgcjHTGJq6dzbKP3I9iWpXJ1LjG04HVJWbP0uRkwqwgoMRDA2EBeYN 7fpun+G84c3m0ugNTf03nFXppRL9/vPzTOa47k9sShCdH56d+nwQce1VHchGgXnRCuAR j/Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=pdKgFBSjrP7J6mKQWKcIHbUGqiu8JHE7FpanMMKui3g=; b=E6xx3W0m3aWIDpiZM3LOk5h/H90NNuVYyaHAgEPqlr2mKmN0jpoxnP5djAMOJoSgNA JvhT57sl56IWftMFZwGCm/Y5Qm7fSusiVvslRDspaIhOyPAjzU27PbmE1aCSUwynp+Hk m7SzTKOOC2tdG1a0jpiasMg5WKW+/3dTlPVHNULuKIHXayLL52OCjra6vvfHx++TW5Ee kIOvrv8zn7wrTlfRY7PavAzVnuu5gkrrYk2w8NCgsaVvseQ75+BIwvUPe0xaZ7n+RAsk jkcMYAQlpgEilrkYyxbCqF0AJm/D71l4qmNwvcQERyHCcnjF7Mg7wcNXQw1hvqP0S6EC 6Liw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=xs4all01 header.b=BgVJUG6v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt24-20020a170906dfd800b007317274bb0dsi2648626ejc.979.2022.11.18.06.53.32; Fri, 18 Nov 2022 06:54:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xs4all.nl header.s=xs4all01 header.b=BgVJUG6v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241577AbiKROnh (ORCPT + 91 others); Fri, 18 Nov 2022 09:43:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242085AbiKROnO (ORCPT ); Fri, 18 Nov 2022 09:43:14 -0500 Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7883213E3D for ; Fri, 18 Nov 2022 06:43:06 -0800 (PST) X-KPN-MessageId: 52309e82-674f-11ed-bd66-005056994fde Received: from smtp.kpnmail.nl (unknown [10.31.155.5]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 52309e82-674f-11ed-bd66-005056994fde; Fri, 18 Nov 2022 15:43:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=content-type:from:to:subject:mime-version:date:message-id; bh=pdKgFBSjrP7J6mKQWKcIHbUGqiu8JHE7FpanMMKui3g=; b=BgVJUG6vwXZgwsVHy52Z9oCXmaMqSN+28IZDHEUPzlrFkGElqCPZMgN6VUdjQ62RZYOHfu4fIBXfu bOhoGzmtirLjc6X3v+HdKmf8O5vv/OLYFKSmfVZI8o8XkoVfI71X6OPlVfXZ1Jvblt9sh7/fyYfBZ6 r7XCD6jSWatpceQb4l8N+aPqd4CU1b5GsRxz5j/XAMmIxG6NB0MtJKrJaZsvjpbbxDhormaVm2TU3f o0oZkzzV1TTUG8RpQtuEnSxxMjDaHAtncb5dOoe4FbfBd4W4jce1sIaIWa6QaLRCrZxiBscjjadV8+ 8ro9aFmub64GuhkyjBz4jMQ4YTZKTIw== X-KPN-MID: 33|fFbkAkP83JGUv1qU/pkLvLXfT30fA7fHDImREHGq0OWKitaWJxgZHuYLjNX20sd 8Y4TSjdxnqiTBqkocf6bxo2mf264VvBfGDuMtNnGFIMU= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|aHFuH5bFQHDW5BFR+HnL4ys8tdkYBqpjYSJCY+kUj64PdKCi5JWSVX+hIOzqbkh R4Gvzo2Hok/cWEKeNGFSRVA== X-Originating-IP: 173.38.220.59 Received: from [10.47.77.219] (unknown [173.38.220.59]) by smtp.xs4all.nl (Halon) with ESMTPSA id 4e226081-674f-11ed-9b31-00505699b758; Fri, 18 Nov 2022 15:43:03 +0100 (CET) Message-ID: <9c46615d-2dfb-837e-48a8-9d952c04a824@xs4all.nl> Date: Fri, 18 Nov 2022 15:43:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH] media: platform: mtk-mdp3: add missing call to of_node_put() Content-Language: en-US To: wangkailong@jari.cn, mchehab@kernel.org, matthias.bgg@gmail.com, moudy.ho@mediatek.com, sunke32@huawei.com Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org References: From: Hans Verkuil In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13/22 12:05, wangkailong@jari.cn wrote: > Fix the following coccicheck warning: > > drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:892:1-23: WARNING: > Function "for_each_child_of_node" should have of_node_put() before > return around line 914. > drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:892:1-23: WARNING: > Function "for_each_child_of_node" should have of_node_put() before > return around line 920. > drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:951:1-23: WARNING: > Function "for_each_child_of_node" should have of_node_put() before > return around line 993. > > Signed-off-by: KaiLong Wang > --- > drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c > index d3eaf8884412..4162fc732f38 100644 > --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c > +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c > @@ -908,6 +908,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) > alias_id = mdp_comp_alias_id[type]; > id = mdp_comp_get_id(type, alias_id); > if (id < 0) { > + of_node_put(node); > dev_err(dev, > "Fail to get sub comp. id: type %d alias %d\n", > type, alias_id); > @@ -916,8 +917,10 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) > mdp_comp_alias_id[type]++; > > comp = mdp_comp_create(mdp, node, id); > - if (IS_ERR(comp)) > + if (IS_ERR(comp)) { > + of_node_put(node); > return PTR_ERR(comp); > + } > } > > return 0; > @@ -988,6 +991,7 @@ int mdp_comp_config(struct mdp_dev *mdp) > > pdev = of_find_device_by_node(node); > if (!pdev) { > + of_node_put(node); > dev_warn(dev, "can't find platform device of node:%s\n", > node->name); > return -ENODEV; There is a 'goto err_init_comps;' in this function as well that needs an of_node_put(node); line. Can you make a v2? Regards, Hans