Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp855048pxb; Thu, 21 Oct 2021 10:43:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2bGsu0gM2YuXoW5PJQd26dnEv53DJGAoKqgcRBmuRSw8TlSsY6dmTQweryfiDtgL/zBHZ X-Received: by 2002:a17:902:b218:b029:11a:bf7b:1a80 with SMTP id t24-20020a170902b218b029011abf7b1a80mr6497064plr.82.1634838234155; Thu, 21 Oct 2021 10:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634838234; cv=none; d=google.com; s=arc-20160816; b=zV4/rO8B40wFlEKPYa1TGlLGVjxFwZnEcIFvtJJ2hh59t8ikWU65h8cJO9MsW0rmFp LmEAUxHM70eQ7RyL3Ll8t0uYUIpUb/rMxTshBfnyc6r/wZyMefSqeDHxwuxJg/cahacv YXlsEqGMXCxVXSQ79lmCKWHrbSSskPlvEgazFnYYVCcmlg8uxkT9jlE4fz5LuLqeyEuD TKkPI0lJjTp4MsBJzHqXM2Zl5K647GFUAxzaqff5qS5SacCmIT+NT3mfdWWWoX0XeUos 5k91J7BMIyBw/+57y4NOv28IUMZFSI3fEmfY2nWaYqZBbRKeFKp2cM+5ySSGCkXuyvOw QSRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wjkL1M46brws6JUD91gGE9nrGWZDkt+GYrNQD2kz+m8=; b=zuYAeYXxRmrgYXAtS74T6MveJOtL9ZkfmvhYY1D7ggCWQUnSf2DEYwAZSPE24oZl9C 1NQDT4Frk4/dTY/0zW+XErClClBTN/KrtvsjU/thSoB2AyIgQcgMHn5VtOfrvbx95Sha jyoNxmeDuwxYcegvpcWmeGCnT0jw2UtTxVAvIQ3dEJw+KtVgZU/Bt4xCjw07NKiHjyx1 LbvZqYF1nFGTHbciPdETifuxh6HMJzHJoc7l1KVdWIkBtZf8BtRkkyHle94QUjYoL9Sl nJpvJqymgXehXHVTsmnAjqL4Qs1OqzDWNRN6DGZQFscLqRdhrbuaxhAVwbzVYUy6QN8Z rRLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ULa4ja1D; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si7905653pgh.182.2021.10.21.10.43.40; Thu, 21 Oct 2021 10:43:54 -0700 (PDT) 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=@linaro.org header.s=google header.b=ULa4ja1D; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232183AbhJURn0 (ORCPT + 99 others); Thu, 21 Oct 2021 13:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231220AbhJURnZ (ORCPT ); Thu, 21 Oct 2021 13:43:25 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAB8FC061570 for ; Thu, 21 Oct 2021 10:41:08 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id f21so942258plb.3 for ; Thu, 21 Oct 2021 10:41:08 -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=wjkL1M46brws6JUD91gGE9nrGWZDkt+GYrNQD2kz+m8=; b=ULa4ja1DxUaFql3k+NQDCw+GE2tpfakdVAljWPOrsJt+NBoKh2f0DItAwN+jUjcY9H k7f7DrbEPoc5UN8pYBiaqYbke7pcEn1DMauH0T0Ozx+VmGDCkAMiHn0TQ2tG7UjBtrFx 9V+oMoju8QLX/0Suel9ZUv/MtxBB6vrcNFTZ3rvYi8y9DCcYK8m0fXSf4PTTFdn9lrGt ZM06avbr5hktRf4yQhFqbmVrXIhYOHzZPfUVE3VP7rEgXftCZfEW6XFGMJKeR1eW9wkr Xjomjtxng2cHkzCxpvZXN2U4WHjaamfIwDsIbKUD8xb4KruX4GVJxQI9PiBSnCS0Bb+R 4p7Q== 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=wjkL1M46brws6JUD91gGE9nrGWZDkt+GYrNQD2kz+m8=; b=7pcNVRwET1CVsWtzCFU58h2CaQ65YhSbPsaoB7/aQ0FOPHS1aZN0Ea7RABSVu7ru+G T2M6EVETBcPdDaYRkeoGE3c2PTQKyzcEWbeidZS0vlGBmaPrEGARvuNArlRvhbCtsOSp MUECj8/MU2iK3PwcU4Z6qUB99cBvHLwdzFPBSqXmbllmyrNL5RvRXMWsmE/oUPe5JwhM aATB4NEeGbOsMS5TQpXdcmAx6IzNX9yLznUo34PuFJ7jg+rGpTdxp2z0T8AQOyN7GkM4 UjGoJR9HLYU90kKuiQ1Gg/7p+OURDP3rMMLt/deoYuDHjLLUlYhib4jp8ay5uR1N1WJs fTcg== X-Gm-Message-State: AOAM532rab+AYTalDwgNWhbJE0lcXuLQPOylFVMDxCkTWp1UQxpym6FP RdpVFiDKfWEdPNaffov0EBfhTw== X-Received: by 2002:a17:902:c206:b0:13f:68f:675c with SMTP id 6-20020a170902c20600b0013f068f675cmr6666969pll.8.1634838068394; Thu, 21 Oct 2021 10:41:08 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id s25sm6572669pfm.138.2021.10.21.10.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 10:41:06 -0700 (PDT) Date: Thu, 21 Oct 2021 11:41:04 -0600 From: Mathieu Poirier To: Christophe JAILLET Cc: ohad@wizery.com, bjorn.andersson@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, hongxing.zhu@nxp.com, peng.fan@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] remoteproc: imx_rproc: Fix a resource leak in the remove function Message-ID: <20211021174104.GA3562838@p14s> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 16, 2021 at 08:44:28AM +0200, Christophe JAILLET wrote: > 'priv->workqueue' is destroyed in the error handling path of the probe but > not in the remove function. > > Add the missing call to release some resources. > > Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox") > Signed-off-by: Christophe JAILLET > --- > This patch is speculative. I'm not sure if the added function call is at > the right place in the remove function. > Review with care. > --- > drivers/remoteproc/imx_rproc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index ff8170dbbc3c..0a45bc0d3f73 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -804,6 +804,7 @@ static int imx_rproc_remove(struct platform_device *pdev) > clk_disable_unprepare(priv->clk); > rproc_del(rproc); > imx_rproc_free_mbox(rproc); > + destroy_workqueue(priv->workqueue); This seems to be the right thing to do. Peng - please review and test on your side. Thanks, Mathieu > rproc_free(rproc); > > return 0; > -- > 2.30.2 >