From patchwork Sun Apr 3 10:25:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12799518 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 5B0E2C433EF for ; Sun, 3 Apr 2022 10:26:59 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MchLS8GyGV6PhxfHebKLstr58O5XdbFqHtubGNgwofk=; b=O2HE8DnF0BUIta e8pJ3jQ1iVMt/IYGzfJBbarcgyKOi3Z6wi9HqK8ooO1r/bpmEwfz4XjHMn0UFPm9Un3C6qz4jGJ/i ABWsBTPArg4LuyUUeX4KWZYgTPUwr3xVfSYVODNVVvGquxPrVQq25ZGxtSUMJj7K+GP2X46ZYdStZ ayUF8uGUYaVMbwpLdasYJg5ig762p/jnqBt7UT6AqNLZ3e1TESSivA7UIlqWuU4HxhIlr8upCzfAp +OLM4EbExcVCCc9KVi/p5WhPe42y8x4Zo/xYfm0DZehLk1lrYUGaAwRBd6JmSb5x9RCCFoymuH0hE OcujkAPLRmTbb1p3pYvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1naxQe-00BBEJ-Vf; Sun, 03 Apr 2022 10:25:53 +0000 Received: from smtp07.smtpout.orange.fr ([80.12.242.129] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1naxQb-00BBAj-05 for linux-arm-kernel@lists.infradead.org; Sun, 03 Apr 2022 10:25:50 +0000 Received: from pop-os.home ([90.126.236.122]) by smtp.orange.fr with ESMTPA id axQSnFdrzRGzQaxQTnw9cR; Sun, 03 Apr 2022 12:25:41 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 03 Apr 2022 12:25:41 +0200 X-ME-IP: 90.126.236.122 From: Christophe JAILLET To: Bjorn Andersson , Mathieu Poirier , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] remoteproc: mtk_scp: Fix a potential double free Date: Sun, 3 Apr 2022 12:25:39 +0200 Message-Id: <1d15923b4ffb94531435c48482fef276a11b9a67.1648981531.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220403_032549_207137_D08CEE70 X-CRM114-Status: GOOD ( 10.61 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 'scp->rproc' is allocated using devm_rproc_alloc(), so there is no need to free it explicitly in the remove function. Fixes: c1407ac1099a ("remoteproc: mtk_scp: Use devm variant of rproc_alloc()") --- drivers/remoteproc/mtk_scp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 38609153bf64..4a0e6c4bc6f4 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -877,7 +877,6 @@ static int scp_remove(struct platform_device *pdev) for (i = 0; i < SCP_IPI_MAX; i++) mutex_destroy(&scp->ipi_desc[i].lock); mutex_destroy(&scp->send_lock); - rproc_free(scp->rproc); return 0; }