Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp417291pxr; Sun, 10 Apr 2022 19:29:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy0A/W/m2exddYoK6XWWmXigbZeZEeIjpIlyYaFCuomKot+6SkwCk0orc+JgrFFkYilihc X-Received: by 2002:a17:90b:789:b0:1bc:293c:1445 with SMTP id l9-20020a17090b078900b001bc293c1445mr34047449pjz.111.1649644163924; Sun, 10 Apr 2022 19:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649644163; cv=none; d=google.com; s=arc-20160816; b=zuS/wQW9EtpzYi78WagaTrmVJ8NbbSlOOPI9cqcbfX+4RcpQHz/Skv1M87WzR84ku+ alqZQ407n9W+/iya/44ZmZYLZSdU91FY7VLcEUOCA12FQ4H+9dnjgUjmKVuwjkUh614Y PjdKf6atgSkz7s1/iWWlbZtl6rNUTVDa67AEqpchZIlda5R+QTZeuKdPw5gjvine5USh Y3cEE/WlBrFuOLTd0keaAzd0apuN0yMUe51handKGOzFGJIoKhhYqzlRwPuDG5GeezzJ 8HDkQvUyBSFN9ZCVFNxQl9S1iT9LlLp59p94bW30C/LB+xCqiHR/5/rrNTbS2AqdOfH/ 6UBA== 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=m4eTOBxquZj/Z/owh8KXQGroA1vUsdGt6m3yZvEJehs=; b=nYpZG/JnJIvU2wtStw+2Quk0OdHxIi0UEasgTvrVBothombYixyk92paguQCkh80w6 6dOjGDItFC3ohdj+Q45LIae1rXHAO+IZthE8q28n3UgP1XzuzMIVNQyjaBr9rD+dVVk7 WaJ7SOww0YZc4U3SBjymPgjJEURi5drjOlqSOw+XuUojWtB1IXOD6Tz2eqYCpqBFW+ua fLCxuLNr5+VvOXQfxes7yBMj+f1+1HlDX6uPv4/Qr2dk1tvGjjX0QczlELn15FBFufIK kSsrxQNqREIY8VnaRCo4OQ1OuWpfBa7p4iwKgNKNLyKU7qR7oQwepxKSSjYyn6/cZlJL sCuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 142-20020a621894000000b00505b3204852si3118841pfy.270.2022.04.10.19.29.08; Sun, 10 Apr 2022 19:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239016AbiDIGaK (ORCPT + 99 others); Sat, 9 Apr 2022 02:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230444AbiDIGaI (ORCPT ); Sat, 9 Apr 2022 02:30:08 -0400 Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49DF01EC46 for ; Fri, 8 Apr 2022 23:27:59 -0700 (PDT) Received: from pop-os.home ([86.243.180.246]) by smtp.orange.fr with ESMTPA id d4Zgn0yPQNEW1d4ZgnPvBC; Sat, 09 Apr 2022 08:27:57 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 09 Apr 2022 08:27:57 +0200 X-ME-IP: 86.243.180.246 From: Christophe JAILLET To: angelogioacchino.delregno@collabora.com, Bjorn Andersson , Mathieu Poirier , Matthias Brugger 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 v2] remoteproc: mtk_scp: Fix a potential double free Date: Sat, 9 Apr 2022 08:27:54 +0200 Message-Id: <1d15023b4afb94591435c48482fe1276411b9a07.1648981531.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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()") Signed-off-by: Christophe JAILLET --- v1 -> v2: - add missing Signed-off-by --- 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; } -- 2.32.0