From mboxrd@z Thu Jan 1 00:00:00 1970 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 6419BC74A5B for ; Tue, 21 Mar 2023 09:03:20 +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:In-Reply-To:From:References:CC:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m7dQag6NBM6rEuWvwMCumGlOriy1g6zYZH4RdXwSTiw=; b=DADK1NQkIboP5t Qw0vvtvOCeR1wc+5ZSjzIUYZWzGOYz6db+TMZ2UXaU6iwAiWb6o6YXcpBUvo/Kv6LE6gg5S7rkjM2 xJjAoswe+yU8izaHleWd4E6uavz3jftLMg18+Euq9TRvUyLWxmHx5pQAmoPEyHG6FTYu5q5zY+p1B cSr3iP9mWhXTDWNx+mhiDJjcMtR1glOqGei6Bmrgytuo8CXtDM//l7Nz/iLI+TFSzZz+38sLdGbHa LmIn3+XMMvXx+u8TCVkyvvnsPWK1gNMnapQbOvDaHuS4ZzIR/JaaWY8+ClrQbwVHGeBFMlZbqWyVR vfjqAv1hSQvFIJdF/wyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peXsy-00BpG0-0x; Tue, 21 Mar 2023 09:02:28 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1peXsw-00BpEn-0F for linux-arm-kernel@lists.infradead.org; Tue, 21 Mar 2023 09:02:27 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32L7RnXc018738; Tue, 21 Mar 2023 10:02:20 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=dFP8kD4JWYtTPxrGzcHXUMzOQSup5mN+Ww4ICrRqx64=; b=WH0Ic5vCxGGoZGDnW/WZcPwEokNGuYHSiLG+ji76x/GfsxXPQUeHHK87x/Nbcy0YpsS1 JHa9u6Bi61UEnOV3xj9qKd9QcdO5mw486R1Ki01lSlhTl4Ol+3pF2dLnkQ8AaMXsKG9w WQgy+p67IkgTaj6e70VADhpV3tJSO93dzcs8l06TLAPngVUJJ+ky80+e6eIpiDGKs0cR WAzIpM+KBC/Ws93xJWDWlDbVZVK9BdUBSq6moeXWMdB+VVb/Jg+UCMlZgi5o7rHpUQvJ 224YniUQ+8JBKUmEhHaCugMpPlN2fJ/j8QxHkiOAC+Iamt5EP2e/0u/Ys/gUYTr7rL4S Xw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3pf875rpmj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Mar 2023 10:02:20 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8F48410003B; Tue, 21 Mar 2023 10:02:18 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3A7552105A0; Tue, 21 Mar 2023 10:01:52 +0100 (CET) Received: from [10.252.5.41] (10.252.5.41) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Tue, 21 Mar 2023 10:01:51 +0100 Message-ID: <2d217351-53db-8978-9fe6-0e02bb4d4897@foss.st.com> Date: Tue, 21 Mar 2023 10:01:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 2/5] remoteproc: st: Call of_node_put() on iteration error Content-Language: en-US To: Mathieu Poirier , CC: , , , , , , , , , , , , , , References: <20230320221826.2728078-1-mathieu.poirier@linaro.org> <20230320221826.2728078-3-mathieu.poirier@linaro.org> From: Arnaud POULIQUEN Organization: STMicroelectronics In-Reply-To: <20230320221826.2728078-3-mathieu.poirier@linaro.org> X-Originating-IP: [10.252.5.41] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-21_06,2023-03-20_02,2023-02-09_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230321_020226_392013_3596C196 X-CRM114-Status: GOOD ( 18.73 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 3/20/23 23:18, Mathieu Poirier wrote: > Function of_phandle_iterator_next() calls of_node_put() on the last > device_node it iterated over, but when the loop exits prematurely it has > to be called explicitly. > > Fixes: 3df52ed7f269 ("remoteproc: st: add reserved memory support") > Cc: stable@vger.kernel.org > Signed-off-by: Mathieu Poirier reviewed-by: Arnaud Pouliquen Thanks, Arnaud > --- > drivers/remoteproc/st_remoteproc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c > index a3268d95a50e..e6bd3c7a950a 100644 > --- a/drivers/remoteproc/st_remoteproc.c > +++ b/drivers/remoteproc/st_remoteproc.c > @@ -129,6 +129,7 @@ static int st_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) > while (of_phandle_iterator_next(&it) == 0) { > rmem = of_reserved_mem_lookup(it.node); > if (!rmem) { > + of_node_put(it.node); > dev_err(dev, "unable to acquire memory-region\n"); > return -EINVAL; > } > @@ -150,8 +151,10 @@ static int st_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) > it.node->name); > } > > - if (!mem) > + if (!mem) { > + of_node_put(it.node); > return -ENOMEM; > + } > > rproc_add_carveout(rproc, mem); > index++; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel