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 B6BF7C43334 for ; Wed, 22 Jun 2022 16:49:24 +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:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Wqp6Vly9k8A01hAWfayVwmrGu8iCNpjL3JCtxIQpdCc=; b=1ySeBEX1Ms11Y3 oNitsAIpSMyvo8OIQjU2DMoHNC0yf4c/sZBhYbSBntIj0QAD/GJ2HFknfrN+Kft72uLG5aGuZ1qmJ hyJ1VEJP2d0FWinQ48CuSA8x5BiM/bQ1J+a01MvjWvyMQTDnrEy1ciQyr+NVgA7KEf8yQBkdbx9z2 ZEKVaBESeZdC5Z4KpFxebw7YdexP6gCn6YUhD3P/O0VL7KdU3A6X5fEe4yIvHBPPR7ZOYfRrUC2hk 8IiFIOtwZBTGGhTXvfFhHu6JHhZQmWt9EJoZpRxjaudwffjAeUjBWsQ+IAt8Ol/KEmLMsNeifs/AX FWbfgMgcRs0j6uDi0E6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o43Wd-00Bbl3-BS; Wed, 22 Jun 2022 16:48:19 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o43Wa-00BbjF-Pm for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 16:48:18 +0000 Received: by mail-pj1-x1035.google.com with SMTP id a11-20020a17090acb8b00b001eca0041455so1736029pju.1 for ; Wed, 22 Jun 2022 09:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=EPjBWJp4+cnUmhtsaExpC0uH3Ar9b7Yqno9YlbKDpEM=; b=O/WI9RxqyY3j9zZPBjaivC4PBQRKM241XaCzEoMcdZCZTaGiYw5vhL0IzXVEeZ9/cu AfzrnymnQw3E1bgnkaS1k+2DFHWec4a+AZuK3hAage/ENOYpm2dD8Z9M7e5BmGsmhX5M cvZh0UuXxLxLDa1UHU6e2uVEKX93bEm5xoncoyPX6AqX9KyS7X9r4NOwTuBYMN3eSDVP i2tOv6T/D30iwOCZdCgvOrVLW/fJ+JYJMS3WSKTk7Dp8La6AAiKBEK3z+eYYndqeVoZ9 5oLHSzh9t87UCBwDWN2LjbIb5ypDPhnPGz6qQsD75wgIuDAoMEVuOMdd3S/OHMKGCeIR bwyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=EPjBWJp4+cnUmhtsaExpC0uH3Ar9b7Yqno9YlbKDpEM=; b=aG5L6DFFwY9a5hg/I/g5atr1SjRTOcfs9DEQ40wCa01QtMkYhiBDgG2OC+/9ENmC6+ k8zhgQzVGNl31wdGMcejnMpIfnP1QhGlOPlAJlk6u8lBeS6FXBOp8zsv8XT/ivgdSAer 1XHV+VhYxJjpQsCzO6CQywzPKBlfYV/Cos1s7OUSEWZMzfhYM/lrKdaLKGPHtIFxkN3o AL+WswedyMnKtGWoo27e9TwR/J6PRqOFgrgM36CiBUxjWHQeX0ncUIulweTojWdVROcO j/OmkW/T1DuTPJoUwniH+lPOPxUipk0tP+0jwz/cDgbJFxKi5HuQH+M2n2sDTfercGXi UgXA== X-Gm-Message-State: AJIora/2yqlgs+l3tYvkV5MOYHjNp3h6vxPRHUjhOuXRldflwyLuFLaF FZR2WojzjHHHouYp1gcRLWIwWw== X-Google-Smtp-Source: AGRyM1vZBhmsccGkxKPwH1Yo3egL09IVaEXsJhBfwL5fLkZIk1hFm8xi2xqkz2GE870z9R+SkO1ZgQ== X-Received: by 2002:a17:902:8689:b0:14e:f1a4:d894 with SMTP id g9-20020a170902868900b0014ef1a4d894mr35075563plo.65.1655916493753; Wed, 22 Jun 2022 09:48:13 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id x82-20020a627c55000000b0052089e1b88esm7425385pfc.192.2022.06.22.09.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 09:48:12 -0700 (PDT) Date: Wed, 22 Jun 2022 10:48:10 -0600 From: Mathieu Poirier To: Miaoqian Lin Cc: Bjorn Andersson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Peng Fan , Oleksij Rempel , linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] remoteproc: imx_rproc: Fix refcount leak in imx_rproc_addr_init Message-ID: <20220622164810.GB1606016@p14s> References: <20220512045558.7142-1-linmq006@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220512045558.7142-1-linmq006@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_094816_881653_BFD17C3E X-CRM114-Status: GOOD ( 19.37 ) 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 Thu, May 12, 2022 at 08:55:58AM +0400, Miaoqian Lin wrote: > of_parse_phandle() returns a node pointer with refcount > incremented, we should use of_node_put() on it when not needed anymore. > This function has two paths missing of_node_put(). > > Fixes: 6e962bfe56b9 ("remoteproc: imx_rproc: add missing of_node_put") > Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver") > Signed-off-by: Miaoqian Lin > --- > drivers/remoteproc/imx_rproc.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index 7a096f1891e6..6363ed40854a 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -559,16 +559,17 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, > > node = of_parse_phandle(np, "memory-region", a); > /* Not map vdevbuffer, vdevring region */ > - if (!strncmp(node->name, "vdev", strlen("vdev"))) > + if (!strncmp(node->name, "vdev", strlen("vdev"))) { > + of_node_put(node); > continue; > + } > err = of_address_to_resource(node, 0, &res); > + of_node_put(node); Applied. Thanks, Mathieu > if (err) { > dev_err(dev, "unable to resolve memory region\n"); > return err; > } > > - of_node_put(node); > - > if (b >= IMX_RPROC_MEM_MAX) > break; > > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel