remoteproc: mtk_scp: Fix a potential double free
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 9 Apr 2022 06:27:54 +0000 (08:27 +0200)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 12 Apr 2022 16:22:00 +0000 (10:22 -0600)
'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@wanadoo.fr>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/1d15023b4afb94591435c48482fe1276411b9a07.1648981531.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/mtk_scp.c

index 3860915..4a0e6c4 100644 (file)
@@ -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;
 }