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; }