Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3570813pxb; Mon, 24 Jan 2022 12:29:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQ+03P/pH8lWCb7GoPrJK0xcekZ4EV8S5SL2ApTtNLQnFOJuozFWObaM8OPtSzdAYYatpK X-Received: by 2002:a05:6a00:130a:b0:4c5:9f7d:c607 with SMTP id j10-20020a056a00130a00b004c59f7dc607mr15133510pfu.30.1643056169473; Mon, 24 Jan 2022 12:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056169; cv=none; d=google.com; s=arc-20160816; b=cU0KYeWN9LzKmyyLCZkeRuYgnh8C1kztqgc6C3Y3xlDbBZbjYoFZdhVPfy8ZOnlI3d Ya90HbIPynHF6Zg5Y5l/DN2R7LiouIrYQtk0WM+CNZ673kXYCl9xw+7ykaIZVRBp3jjS dHKqrIa6L7JTQSCoQkGaMxo3Ml6jSHoUjngYUSzNzyq9mukuKngywDdBFhOISomZvWAw 05AYQln9OF72eA33lwg0hbUnZAXMtsXme1VqQ0hULo+Q4DCjJF/Bjg/yliKmu91AvOWJ 6QMNBRGUQnc/ZZ8Ust9vgQgdXPrPpcxrxgTILVkPJtfc6zbpb3veFb6pRttdx9WIxBT1 1fUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jAymvM2RXrDps7nHVjba1BdabqL+Gz15B7du1q/yEis=; b=mOd8Tr55oz22DP0jOfNKd8eY+l2nVlEZ5J04OxNVEghzzds59U7m5ISVd7R0oPGJjb t8NKmBxyWf2ZRGhhO8msIOXy8mxDtZ2mHCfK/ncx/cXXzL2UJgbUNkbMtdId8ngyOoyZ zLY0lJ8EZ7V5DndkSFFEOkjHuPBCLceSCQwweXgDxiTEo8CzdGOOhJWAGQdGH27jljwX VIO6WIYKN+NM6hPD6R811Lewm7+ChIMVW+XTBeTKDtKsPuP1LYB+HhXC80JXSqD8jY7k Qxyjocx3k12iPCUKBb7fOpugq1cuzWa5LhotelegZRM4tp5JBCo/eM3tRylhesDDQH1d bkZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tvgDF5Dm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot5si371628pjb.88.2022.01.24.12.29.14; Mon, 24 Jan 2022 12:29:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tvgDF5Dm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352819AbiAXTbG (ORCPT + 99 others); Mon, 24 Jan 2022 14:31:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349989AbiAXTXA (ORCPT ); Mon, 24 Jan 2022 14:23:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C265C06138F; Mon, 24 Jan 2022 11:09:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D0C6F60B86; Mon, 24 Jan 2022 19:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2A41C340E5; Mon, 24 Jan 2022 19:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051353; bh=eRQgN6+6B/sk/4CSMI+LPdFbwm4PJOHQJ/Ld8kx8M0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tvgDF5DmSdxdG1Cg9CJCdOXhLnknpb9+RHSXP0UbzXb4KUnm2qUiUU60EFon8a7+C Dmzf5i3OAwVjO+/RUbh5QJ7ORntEn8euxaCHfMMFWGsbGTvDlY0qNkEMn9YAeqFr1s MdMqZm79A1HHNLDu6tCoBfzs2ZU3ewVFAizPmwoQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julia Lawall , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 134/186] powerpc/cell: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:29 +0100 Message-Id: <20220124183941.420864123@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julia Lawall [ Upstream commit a841fd009e51c8c0a8f07c942e9ab6bb48da8858 ] for_each_node_by_name performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression e,e1; local idexpression n; @@ for_each_node_by_name(n, e1) { ... when != of_node_put(n) when != e = n ( return n; | + of_node_put(n); ? return ...; ) ... } // Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1448051604-25256-7-git-send-email-Julia.Lawall@lip6.fr Signed-off-by: Sasha Levin --- arch/powerpc/platforms/cell/iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 4b91ad08eefd9..c4f352387aec3 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c @@ -1088,6 +1088,7 @@ static int __init cell_iommu_fixed_mapping_init(void) if (hbase < dbase || (hend > (dbase + dsize))) { pr_debug("iommu: hash window doesn't fit in" "real DMA window\n"); + of_node_put(np); return -1; } } -- 2.34.1