From patchwork Thu Sep 7 09:55:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 13376327 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 660B3EE14DB for ; Thu, 7 Sep 2023 09:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yBbTSfFu4LKVghpmi6xcGN7kumHBUFvTdsHhkfX/m6k=; b=AAjcBlaVVYTs3l 1JmJ1dezXoLS98mCiuup9OQLquk5DGQMCMWjhz5lpr0RfyXXXEo47MKh6nkfgY/P8aM3t8RgezVwz HaxwZzxnEYPRZt4pS7QQR2Yh9vk07ArOwjxElKCizFgiHv9o509CSfCoUgXS75NdHBTmeLI0ydILZ i16STHH+R+KAbyiBZa8aeVghhXrb5LeDB/lZ4vBEh4JngrKcmsqK+to2A9SkcvO55mDQ7kXEp+djr Ad/Lud7mNQBXfwGZ2xihIRaz1yyzUDK2tHX3YVW9e7PGsXLtU4ZlC7sZLfYz9C5Yx4HBTT18gzM2i ypSrD9i68ovIWm9QQKbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeBji-00Bj7S-2i; Thu, 07 Sep 2023 09:55:42 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjg-00Bj4d-06 for linux-arm-kernel@lists.infradead.org; Thu, 07 Sep 2023 09:55:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yaKS76r33jDdN4YRfQ9rWXkWuhK5u7HSRxlycGPVIFs=; b=btpK9sTraVPQp9hlYQYmLOZYuH4BemJfQO3Y6HfD7eMk6iciEM3G6gVp gj/DRuzgUayvoqqq1TEMEU1F88NNsRqJhwhhrETcRNKUTBsvLlgnP+2wx lmxSMbY4fUz+f98xZQTgpmAFpRGIQkc0iRe7rlU3MfCQyhTCBe4QtKCPv g=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=Julia.Lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.02,234,1688421600"; d="scan'208";a="65324659" Received: from i80.paris.inria.fr (HELO i80.paris.inria.fr.) ([128.93.90.48]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2023 11:55:30 +0200 From: Julia Lawall To: Nishanth Menon Cc: kernel-janitors@vger.kernel.org, Tero Kristo , Santosh Shilimkar , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/11] genpd: ti: add missing of_node_put Date: Thu, 7 Sep 2023 11:55:14 +0200 Message-Id: <20230907095521.14053-5-Julia.Lawall@inria.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230907095521.14053-1-Julia.Lawall@inria.fr> References: <20230907095521.14053-1-Julia.Lawall@inria.fr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230907_025540_371614_A1F3B1C3 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org for_each_node_with_property performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall --- drivers/genpd/ti/ti_sci_pm_domains.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -u -p a/drivers/genpd/ti/ti_sci_pm_domains.c b/drivers/genpd/ti/ti_sci_pm_domains.c --- a/drivers/genpd/ti/ti_sci_pm_domains.c +++ b/drivers/genpd/ti/ti_sci_pm_domains.c @@ -153,14 +153,18 @@ static int ti_sci_pm_domain_probe(struct max_id = args.args[0]; pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); - if (!pd) + if (!pd) { + of_node_put(np); return -ENOMEM; + } pd->pd.name = devm_kasprintf(dev, GFP_KERNEL, "pd:%d", args.args[0]); - if (!pd->pd.name) + if (!pd->pd.name) { + of_node_put(np); return -ENOMEM; + } pd->pd.power_off = ti_sci_pd_power_off; pd->pd.power_on = ti_sci_pd_power_on; From patchwork Thu Sep 7 09:55:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 13376328 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84ADDEE14D0 for ; Thu, 7 Sep 2023 09:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qt+W1Saw1iWhSxCBawQUrcLyq4JLrGYumx6tBhQTklU=; b=1qcl1CKheHRCQx GTJacjyqlTmi6HLNTEP/hpaVK8+/i96S0D/VbbsMf/MQVALfVSclpLJObymFlgY//bHKOmhxdMv2m GzBb04YK/OTbWfh0uH+b9LC+Ux7ndngJE3vJP/Lg2Z+v3kVMHQm813Z3zV66aivhj6hl1SUMuSQnH zjl4OopJop6j6Aub3aNKvPhKp5TQLStLW2Hyvl+n40h77OA+Qu6l1i8QusXs7hSCOw7tSr+qT5fUm vmNMeXBQPnQvVVlemlAfDJoRGZKbSl1aMrbTf14SHe4Iq+xePBdq2Im2fi6aaz85jkBMhXtCgmvrQ llx1fkTjdUz1kIAk3Ttw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjl-00Bj9G-0Z; Thu, 07 Sep 2023 09:55:45 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjh-00Bj5t-0J for linux-arm-kernel@lists.infradead.org; Thu, 07 Sep 2023 09:55:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+2+9PhsuxDwz9dE+S6gEk9jxLadNKiKHknoMCAQwIgc=; b=ec2hSo3RvbTzXAU9Em5Jk0wWXJgPsfJhh1T0sN3SyNEV4dathB1A7cie yS6Fkxp45Sac29NV6olxKUtJpxAjKXpN1WdxaxALrxE1tjayd689lkzZK K0VEppJHcfKw1TeXxiXGaXpwv2YqDqgS5xrSkiG21UDNui6PGRSaJ8AgW 8=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=Julia.Lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.02,234,1688421600"; d="scan'208";a="65324661" Received: from i80.paris.inria.fr (HELO i80.paris.inria.fr.) ([128.93.90.48]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2023 11:55:30 +0200 From: Julia Lawall To: Ludovic Desroches Subject: [PATCH 05/11] mmc: atmel-mci: add missing of_node_put Date: Thu, 7 Sep 2023 11:55:15 +0200 Message-Id: <20230907095521.14053-6-Julia.Lawall@inria.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230907095521.14053-1-Julia.Lawall@inria.fr> References: <20230907095521.14053-1-Julia.Lawall@inria.fr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230907_025541_436896_57615947 X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , linux-kernel@vger.kernel.org, Alexandre Belloni , kernel-janitors@vger.kernel.org, linux-mmc@vger.kernel.org, Claudiu Beznea , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall --- drivers/mmc/host/atmel-mci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -u -p a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -674,8 +674,10 @@ atmci_of_init(struct platform_device *pd "cd", GPIOD_IN, "cd-gpios"); err = PTR_ERR_OR_ZERO(pdata->slot[slot_id].detect_pin); if (err) { - if (err != -ENOENT) + if (err != -ENOENT) { + of_node_put(cnp); return ERR_PTR(err); + } pdata->slot[slot_id].detect_pin = NULL; } @@ -687,8 +689,10 @@ atmci_of_init(struct platform_device *pd "wp", GPIOD_IN, "wp-gpios"); err = PTR_ERR_OR_ZERO(pdata->slot[slot_id].wp_pin); if (err) { - if (err != -ENOENT) + if (err != -ENOENT) { + of_node_put(cnp); return ERR_PTR(err); + } pdata->slot[slot_id].wp_pin = NULL; } } From patchwork Thu Sep 7 09:55:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 13376330 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3378FEE14D4 for ; Thu, 7 Sep 2023 09:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pH9onSHjfE9YhUrwWNtJ5nlBynTIraLWuSlg58a/bsg=; b=UsIzb5TFmpaneH YcKOSR5EmA9UyIZCr/8TD6M9O+WjBYRl3UzLmiPsli5nyaIVZpY4mCIpndNvrJdVKZF0c++TRfTcz fipyr6SDtxRNQto+dgq1rWa8h/cs92zRcpFyc+pyVi8FPoz39PWZ2mBOtpW7j3QadWeWLb/tH7cHY SRKEGn1eqie2hz9SCqZfLEbCIfc4zqrL0naQi8AcoA2isdsm2YpLL/oJw8zuvpW3n9CJoTqznqVha HAL6DvLhQEpIdo7lGacYzAYDoF+Mym5G/2pVfWzOkh2mSjxRftRJq6Ppmj3iLvl8KikXbybIWnWpt 2CgfrCA/J0EcHOMPVNmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjl-00Bj9i-2F; Thu, 07 Sep 2023 09:55:45 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjh-00Bj4d-30 for linux-arm-kernel@lists.infradead.org; Thu, 07 Sep 2023 09:55:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VfFUOzTRHnfQoRWB3qwW+hiJagSmS8zXaUaAHzE1SIQ=; b=Juh8pIJXWVjv+NJ+qa7cACxOjOi36J5CkkicX3z+SH5X1Nv24HboikUN qBBv64vnRyKvcb1xbeB8yg6wV0xKaIh9i2ViLBRcHSBcVS7c7Ggc9XOb7 aiN9B+GhVPBNP6Z+EP3RbpanUOHzdv0gXemqDqeHH7uYNdPTRmo//SMIe Q=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=Julia.Lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.02,234,1688421600"; d="scan'208";a="65324665" Received: from i80.paris.inria.fr (HELO i80.paris.inria.fr.) ([128.93.90.48]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2023 11:55:31 +0200 From: Julia Lawall To: Andrew Lunn Cc: kernel-janitors@vger.kernel.org, Sebastian Hesselbarth , Gregory Clement , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/11] soc: dove: add missing of_node_put Date: Thu, 7 Sep 2023 11:55:17 +0200 Message-Id: <20230907095521.14053-8-Julia.Lawall@inria.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230907095521.14053-1-Julia.Lawall@inria.fr> References: <20230907095521.14053-1-Julia.Lawall@inria.fr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230907_025542_264032_A0C70CF5 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org for_each_available_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall --- drivers/soc/dove/pmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff -u -p a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c --- a/drivers/soc/dove/pmu.c +++ b/drivers/soc/dove/pmu.c @@ -410,13 +410,16 @@ int __init dove_init_pmu(void) struct pmu_domain *domain; domain = kzalloc(sizeof(*domain), GFP_KERNEL); - if (!domain) + if (!domain) { + of_node_put(np); break; + } domain->pmu = pmu; domain->base.name = kasprintf(GFP_KERNEL, "%pOFn", np); if (!domain->base.name) { kfree(domain); + of_node_put(np); break; } From patchwork Thu Sep 7 09:55:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 13376331 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CDEF4EE14D0 for ; Thu, 7 Sep 2023 09:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dnv46w5eAPrPLD1zdfNyL2NdGziVqJP82KbgmD442K8=; b=dskI8qlYtwjUUY j0TzALfqkGcW/X8MEcMgyVbeWIVXjpDuGRaGU76GwM38cVbRKxjD+E1q7umBs9IsHIco4KkSquYIe 3uAfOsJ2kwhLXGBLmVi1jSNm19us/XQR0+XQb1y3Yprzc5QkFAd1ZlRQ2HBe1lwxo7F8hODbNvRUf cVLsHqcF95R7VinX/HNlFCkeWLtdZH1lLBgOup9u8OUz3OZ0/xOVhE5V/fWHCCABxSA4aIG8cnhRc WNrPU1qAB9X1zlYicnSkRqikrydlvMuGqv5WYhDvw4Z4pvof9kN0TGUf8YQ97YLhYrJ7PtKYxJSMA 0UiXuJ1lUAx2Dg6FY8IA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjp-00BjBO-1O; Thu, 07 Sep 2023 09:55:49 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjj-00Bj6y-0a; Thu, 07 Sep 2023 09:55:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u0K12b/gI/8w4RhaCwn2OzPenKaNJKOwO3HnMNvMsC4=; b=IGXETRMV8AOk6o3LqgQH1rzOokANEtntin+l/G9jSGnL1sAZ0V21b/g2 SQLtMbCI9Nxj6s+ojNYVXNs+zV8kzgWmj9XxGORhCOg+M8jOwYHmOneS4 5L6lekDIm2/hrzqwCHO4LEM0yyhCjiK6V0jBVfKbtAH3Y7fYp2wxvEHpw c=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=Julia.Lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.02,234,1688421600"; d="scan'208";a="65324668" Received: from i80.paris.inria.fr (HELO i80.paris.inria.fr.) ([128.93.90.48]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2023 11:55:31 +0200 From: Julia Lawall To: Chun-Kuang Hu Cc: kernel-janitors@vger.kernel.org, Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/11] drm/mediatek: add missing of_node_put Date: Thu, 7 Sep 2023 11:55:19 +0200 Message-Id: <20230907095521.14053-10-Julia.Lawall@inria.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230907095521.14053-1-Julia.Lawall@inria.fr> References: <20230907095521.14053-1-Julia.Lawall@inria.fr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230907_025543_551407_54D030D3 X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall --- drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 4 +++- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff -u -p a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -377,8 +377,10 @@ static bool mtk_drm_get_all_drm_priv(str if (all_drm_priv[cnt] && all_drm_priv[cnt]->mtk_drm_bound) cnt++; - if (cnt == MAX_CRTC) + if (cnt == MAX_CRTC) { + of_node_put(node); break; + } } if (drm_priv->data->mmsys_dev_num == cnt) { diff -u -p a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c @@ -436,8 +436,10 @@ static int ovl_adaptor_comp_init(struct } comp_pdev = of_find_device_by_node(node); - if (!comp_pdev) + if (!comp_pdev) { + of_node_put(node); return -EPROBE_DEFER; + } priv->ovl_adaptor_comp[id] = &comp_pdev->dev; From patchwork Thu Sep 7 09:55:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 13376329 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4678EEE14D0 for ; Thu, 7 Sep 2023 09:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tx6lgGxIJWTXPP18uSJi6WJIwGh3aucEFXEi4MfCXJU=; b=dBLgan5SHx3tlS gEihRWrQ02XtS7L9Flzp13f7bwTc8JSKX+imIiR8jRsbxih42R/A9kIw0FwYqEhyXsSjYNRX1Oppx SFTq0moIA5lZxbaX6BwhNVje37iXe5wFlzYZk/yq+pzGzugT1AySF3itCl0dMTGfgALS8CD3dwDTB sAuZ6+lKfgM5rw7Ar/11Oka5EhPV8N0n/xOGa/kOSvfZO/ZJxGqvla7/2OV8ui8N3WaqmW+uFIWW2 JPtXPH8M4pFp9tlYXs7FhJn1p5/R+kxPFByp0eGZBENleGUvlg5tCjUjV6GsAVwf4JcAkCIQhU5H9 +CIPLOsWYTuGf68EdOxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjo-00BjAT-10; Thu, 07 Sep 2023 09:55:48 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qeBjj-00Bj5t-0a; Thu, 07 Sep 2023 09:55:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uSXuGn3O+qqWl5LwJxGEkPc7y1T0Fvv+zmkZqiAv3bo=; b=Hx88vk+kZ/st88XSOfMxLqrNvqFC5gz0Rjsu9FnmuxDb6Ey9n9iNx7X3 5mvlWqUzb578CukZIhvBvScfv1YGt5HhmEmohAMwtUhRjDPRCDgZnwHdn 65YFgxzTg0Odnf7stkK+lMg7TbECQQOmUA50DEcI4rbfx/H5A9Ng9f7GJ w=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=Julia.Lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.02,234,1688421600"; d="scan'208";a="65324671" Received: from i80.paris.inria.fr (HELO i80.paris.inria.fr.) ([128.93.90.48]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2023 11:55:32 +0200 From: Julia Lawall To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, Matthias Brugger , AngeloGioacchino Del Regno , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 11/11] media: platform: mtk-mdp3: add missing of_node_put Date: Thu, 7 Sep 2023 11:55:21 +0200 Message-Id: <20230907095521.14053-12-Julia.Lawall@inria.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230907095521.14053-1-Julia.Lawall@inria.fr> References: <20230907095521.14053-1-Julia.Lawall@inria.fr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230907_025543_537216_CB2A6316 X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 1 + 1 file changed, 1 insertion(+) diff -u -p a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c @@ -1137,6 +1137,7 @@ int mdp_comp_config(struct mdp_dev *mdp) comp = mdp_comp_create(mdp, node, id); if (IS_ERR(comp)) { ret = PTR_ERR(comp); + of_node_put(node); goto err_init_comps; }