Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2612734pxb; Sun, 17 Oct 2021 20:30:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPQTrEcHy5NbgySf9hWvUIS/zumU5mWx8B39uZ0AgFUeosulacZd2pBFWpUh/KJKwnUx0N X-Received: by 2002:a17:90b:341:: with SMTP id fh1mr10528681pjb.6.1634527815014; Sun, 17 Oct 2021 20:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634527815; cv=none; d=google.com; s=arc-20160816; b=EjXlTL+G+9xf5OHgk9hkrH4L6akxBjMygqkkfsjJ9MhneJZ0FaO9cak9rH/6nEnC4B Iwwq/Nv1EGyzCHCVxlX3TNhDMzqVRNsTYJcvGNzM/sEKy/TSMlnckrKIeHWcvKB6ifJ4 RJW653wOPyNCYOp0vsRIyXE9ww49EQsWNUaknWqsuBYYHHhqgWtMsXsqhnvm8FnF56sq o+vwoFkPqO1TmpIRJJHURNPvGr8EKmmApO0IGyNralwvVX/Ulxrgdp70jNJkfO+Qp6Uu qElRRJp7i/nj5Sx0Tc6Nwd/aQuHIDFWdFA2J3X2Db+YEB8GgysxcusYB5M1Ss0LGBOBu fNKw== 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 :message-id:date:subject:cc:to:from; bh=k+4rZ0doa17KSjAQRyHwhql7TYZIFSuCvyxT5aH1HYU=; b=F8n+9EzZb4kfb9h/0foTHCeYzhJy8iFqNc4+zVb0nddwAiNFaO5YGkugO6lUjtOxwh vHIHaF7WTRctg2sZf08BQ3VN1lRsBXHFzXNXSlVFcmNMZPC+/snC9Es2w6hGg/fNohVQ HcfLnIpRpmcMB87pfWpjq6w1PRlSaNAAbTAuHGnbizg7inf+FTIBZ0edvcqOy044Vvd5 Suxoi54Yi8y5TZO0PA+vkHvgw7S1rQP/trOkGNrW0iC21m+INxeB0B1PTKmHi1lbnYP3 rxflcHVBWpbESQYMF1CXor4xngec/j6Ein12mqunrSCOWOPKt9u6CHfg7aBgJbLL12YT zqtg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si14704658pfc.213.2021.10.17.20.30.02; Sun, 17 Oct 2021 20:30:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243680AbhJPGqo (ORCPT + 98 others); Sat, 16 Oct 2021 02:46:44 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:64574 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236583AbhJPGqj (ORCPT ); Sat, 16 Oct 2021 02:46:39 -0400 Received: from pop-os.home ([92.140.161.106]) by smtp.orange.fr with ESMTPA id bdQjmA0MmniuxbdQjmKDjp; Sat, 16 Oct 2021 08:44:30 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 16 Oct 2021 08:44:30 +0200 X-ME-IP: 92.140.161.106 From: Christophe JAILLET To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@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 Cc: linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] remoteproc: imx_rproc: Fix a resource leak in the remove function Date: Sat, 16 Oct 2021 08:44:28 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org '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); rproc_free(rproc); return 0; -- 2.30.2