Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3719291pxb; Mon, 24 Jan 2022 16:15:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBrthwAgRysm42sSW1Gn4WG2QQxk7J2o7eweQVIL9PqnDlIiRR1/HM+NaY9CT424p/ewFW X-Received: by 2002:a63:5b5c:: with SMTP id l28mr13278560pgm.70.1643069713805; Mon, 24 Jan 2022 16:15:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069713; cv=none; d=google.com; s=arc-20160816; b=Ab3WkXlg5Yfn6I6l++OWfwTo0Lr6DiUbqUAOHcVRQdF+yXNsKQmFQ/QcJ0jhMxjvJO sKatfT9adJ4tKiIcvX3vApTf9B0lo3gRKDnBw1g/cKk9Q7Ls3MPh3CPm19QB9+E5jLu8 3jasWSxz2tXOFPfVjeB0lLdM9H7kYSJD2KSRijKh+KiGEKePcwv4iLZz7XPLEvmTXhse KfCG3FTBGvDBTqEE+UZfoEN3WcBgz/9NpEl9QoQN89GqXM7jRuYdoV9GsNj3FLOwCmn+ d+JTpGG94PzsWt9ebXFBOX+5SmvjfdxgN9HU26wU9qGGuuU7YTVdQJSlSOVhvDepw9Dv G+cA== 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=aXw706tJcqerc/+NJ4WRwF2MJceMjel2dHmBTtTGRH4=; b=HjbOJY1mLwZLJOPKqs83zk8u4Fl43gAraRidAtIg2af9vU+BWtPAWIoZN7Rnw9H33u BtVFLFjRIPB+7NC2NDBSU0ZlaL9cLukYCiNoaoFtj0kcugoQeK6K6nukuK2XUGilX84E Bg6KSWZlumkBMW4+KyVc1LUab7tOGCGligYTwRgssKrZcB+cdPiSNSE8F/MIMRiI3SMC z5ZfZSZdpfOTrTPf8HWgzRPkYlSfLlpOeA/v2dbn2VOalllJdsWJoTO/bNPJlbw1Y0tJ yg794IVImvMPtREArqY5e/7laJqpNqDw3+4+S+2Efy6ztzPHckg6zsvROCAmrxT25Tcb JrTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WvUMCe8b; 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 b4si14051045plg.125.2022.01.24.16.15.01; Mon, 24 Jan 2022 16:15:13 -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=WvUMCe8b; 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 S2372528AbiAYALw (ORCPT + 99 others); Mon, 24 Jan 2022 19:11:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1849404AbiAXXZq (ORCPT ); Mon, 24 Jan 2022 18:25:46 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA448C07322A; Mon, 24 Jan 2022 13:29:54 -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 ams.source.kernel.org (Postfix) with ESMTPS id 93B21B8105C; Mon, 24 Jan 2022 21:29:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C920EC340E4; Mon, 24 Jan 2022 21:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059792; bh=Tivkv/sFkps9YthhNWqLu2xQYDfifae22GMxPKEtHvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WvUMCe8byb7JMlJDgNC4ifbXOwiHWjYHh2XZJjGRjvzGJWzWz2oSLunUvhqqFcEGd AMbvHh3fZExSAvW7Qe8NxOOvYLE3gysRRTwtsNbH3Ybe5H+WihdpKm02sV9Swh+yZ0 mv26oKdSLx4z7rh7L3QNkAOeclvTFEioHZN3rIuY= 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 5.16 0736/1039] powerpc/cell: add missing of_node_put Date: Mon, 24 Jan 2022 19:42:05 +0100 Message-Id: <20220124184150.069215755@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 fa08699aedeb8..d32f24de84798 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c @@ -977,6 +977,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