This is a note to let you know that I've just added the patch titled remoteproc: mtk_scp: Fix a potential double free to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: remoteproc-mtk_scp-fix-a-potential-double-free.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit c4690fbbf247675bfdd2d4ecb98ffc4d8bb9fdd7 Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> Date: Sat Apr 9 08:27:54 2022 +0200 remoteproc: mtk_scp: Fix a potential double free [ Upstream commit eac3e5b1c12f85732e60f5f8b985444d273866bb ] '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 <christophe.jaillet@xxxxxxxxxx> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/1d15023b4afb94591435c48482fe1276411b9a07.1648981531.git.christophe.jaillet@xxxxxxxxxx Signed-off-by: Mathieu Poirier <mathieu.poirier@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index ee6c4009586e..621174ea7fd6 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -912,7 +912,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; }