remoteproc: mediatek: Fix error code in scp_rproc_init()
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 4 May 2024 11:26:46 +0000 (14:26 +0300)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 6 May 2024 19:30:08 +0000 (13:30 -0600)
commit47558cbaa842c4561d08512e531b88cc92d35837
tree16170eae7729fba949b7dab8ba148a360446f409
parent3c8a9066d584f5010b6f4ba03bf6b19d28973d52
remoteproc: mediatek: Fix error code in scp_rproc_init()

Set the error code to ERR_PTR(-ENOMEM).  Otherwise if there is an
allocation failure it leads to a NULL dereference in the caller.

Fixes: c08a82494500 ("remoteproc: mediatek: Support setting DRAM and IPI shared buffer sizes")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/b2114e3c-fa64-4edb-a1ff-d2009e544c3f@moroto.mountain
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/mtk_scp.c