Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3555324pxb; Mon, 24 Jan 2022 12:07:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5XWmgIWyw//uY9Wvumtp9hthsXhC/AmnLUeNwX6T7SJHq247LwERbIu3bpJZc0ESkLql7 X-Received: by 2002:a17:90b:4a4f:: with SMTP id lb15mr2753758pjb.213.1643054838364; Mon, 24 Jan 2022 12:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054838; cv=none; d=google.com; s=arc-20160816; b=yLlzaNOiRnKoJHVDT+V8pxFf9LkVRlce/ioA6JazuPF4vao5+zBMAGkY30jhlMYTdN 7qcdtcx36GGyUVkQo4HwOPgAInawsRdO1OOMlgziZFhZq87hqBk2BqBbO+RRS0ChsBlO ah7TOeDdKCFqK0YBjhL1XzKeSyoSP/QUBUOL4kxizkpTo4yBrDr70bFy0Ddk/6hgUylv YtXlbp9ryCbvodvygRtGUn+zIS73j484gkXzkqsBcLlOUB9xARZnM5hdd2Bb4nKzxaXn DhRCX+HR4YVS+Q/IeYiKK9KA9sr3Pc/qBf7AoTlrKMccPiFM+Yoowq1gghbQr81tuLNa Xvvw== 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=GowfRGcZxlqq0mDEY8dslTav5s8nSBycyENUESgzt9E=; b=XEAGNBERd/NtLLX5q0yxNOyPY1bo8YcUtuOtUR03x4lir/yWHi6DCFcMpJM8IVwKy/ mU+Uhvr0FX3jYAb1J7/nSwZl7j+uppn8vr9tru9BP/YTXDmLPWjg2eMwNbxsDH7Ib7Pa am3zxcSMqzlPrrRvB9t3/+ovw+4Otz+XPc9PSubjAxB1Gd66YBIBZT1ibGkWkB8RQrF/ y1FaLz2uIgmM1//kONToAghU/CpEMjJkdjzoWiN6V6CAMQ8QCKI4EJdv0fAbwFN5NYek EVQTPpHXJTvH/KMBQNWS03PXM0flh3NEDBU6CTyXGo+KMxUGa/PAwWrxvrRvp3OPyB8l F5XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d0Hj4omV; 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 p24si14827381pfh.148.2022.01.24.12.07.06; Mon, 24 Jan 2022 12:07:18 -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=d0Hj4omV; 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 S1346275AbiAXTFP (ORCPT + 99 others); Mon, 24 Jan 2022 14:05:15 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:58564 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344910AbiAXS7g (ORCPT ); Mon, 24 Jan 2022 13:59:36 -0500 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 BE2AE60909; Mon, 24 Jan 2022 18:59:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EDD5C340E5; Mon, 24 Jan 2022 18:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050775; bh=ehxo8YQgznHOl0EbViewbaIP5NiLJZCNpNXsawUryR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d0Hj4omVSC/gbT5VkWrXoDeAft0RgdnaWh75xGAFmBhj5eFI1UlCQyuftjjqChv7l fq8mBZ+gMse6fVab1ubiJb6fPydtfEADykPUvpbr2RslMAtRhIoSijlElNrO2oSD2/ FX1Zx7te5hAdfi3ZsbxJ/tOdRgJPNfJKESbtm73Q= 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.9 107/157] powerpc/cell: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:17 +0100 Message-Id: <20220124183936.163649241@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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 7ff51f96a00e8..8df43781f5db9 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c @@ -1107,6 +1107,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