Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3596567pxb; Mon, 24 Jan 2022 13:08:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJysF1ofoZfBg8zijTxjOA4HPLMWAGB6e6lrWvCx+zxrsCODr6etITTO4EUCU1tDqC6WPf+A X-Received: by 2002:a17:90b:4f84:: with SMTP id qe4mr208165pjb.24.1643058485173; Mon, 24 Jan 2022 13:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058485; cv=none; d=google.com; s=arc-20160816; b=R6wYw6wUrvjFFAJHT0+B9mVZkSiCgF9FdKdQeqEm9zWT2ZD7jrazR7xqk6w/yslbFQ 6Do2pTVapCeWHIM2VfjdpWJ7eglSqjKRoWwEN+KRKvYjR+v/ajkr/EwGhnivS8hXzP2a WDFap5h+p3vwszEunPnOs8307EmwQWK6KrmNWpR8cniC2gmkLtIm4pbHf3am5OEOy0Pb Fhj6GqJGZACTQHIGt5JlTfxmkyfhEYze42BnBzA6A7Su9qKEl7IIBcK0Alj0t7LOZhXi YwTJzE4HiGKZho5+0VqVUW2Gpp9yU134iF6X1r057BFZeQMMEsRNSSsbbyVlye4yFHkz hHkw== 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=5ItouAmy3/gMvYaFRlwDcETV6k2mtFZJs1YxeAYe6Cw=; b=LK4hMi4HrllWpNOGPJvYCvJdfKgGshCinnDl8FIxDZtBLyRdkNVpR/mhYVO2WpByIs zFFK4HvmjOA59PSdh8Bd+RTmkg38Iyat+IJEUOaT1u9e/+4OkbV7/aUo5Lz1sp6pFtM2 MR3RCQQMENssTCYWbegXvaaaWDx0PsLgV7s5pfWGjq2Waxf5RylO2rNUw5qcm2LaJrYv GCVydME3fU2Af77BVkHvsw9IBlZFCIBR3tToXNchqbSQQWz9AqN0QK5FKq3Te/gdxy9r 2l5GmUo75w0PT+aOks6Np282enVmZyBzA51gW2hTo1ZsMhNjbB4EKYt2Sp/RC3L+6Wzq 7dgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ldVc8QYu; 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 r14si14358479pgj.814.2022.01.24.13.07.49; Mon, 24 Jan 2022 13:08:05 -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=ldVc8QYu; 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 S1383684AbiAXUc7 (ORCPT + 99 others); Mon, 24 Jan 2022 15:32:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355416AbiAXUNi (ORCPT ); Mon, 24 Jan 2022 15:13:38 -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 18AADC061762; Mon, 24 Jan 2022 11:35:53 -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 D380CB8123D; Mon, 24 Jan 2022 19:35:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BEDDC340E5; Mon, 24 Jan 2022 19:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052950; bh=RV+GZ1lMaOyQ7OYXWIqi5CS12JZeAKVD0W8zLOYkvQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ldVc8QYuoXWXE4MjuaD6BCSIjZ9iXlk9RPA26csyipxbQLbZ16bwyWsOUzjBe1DBY nHSiFsfnZfBOXG7OmRJFYdcxglKaHFIRTwsGPffr5dEPQavDYcj98WbR2wA2L0lN1f ZV3en8+52FwwuM9Meo51T8ZPUmgejgtgEYWA340E= 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.4 226/320] powerpc/cell: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:30 +0100 Message-Id: <20220124184001.677544745@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 ca9ffc1c8685d..a6a60e2b8f453 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c @@ -976,6 +976,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