Skip to content

Commit 47558cb

Browse files
Dan Carpentermathieupoirier
authored andcommitted
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: c08a824 ("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>
1 parent 3c8a906 commit 47558cb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/remoteproc/mtk_scp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,7 @@ static struct mtk_scp *scp_rproc_init(struct platform_device *pdev,
11561156
scp->share_buf = kzalloc(scp_sizes->ipi_share_buffer_size, GFP_KERNEL);
11571157
if (!scp->share_buf) {
11581158
dev_err(dev, "Failed to allocate IPI share buffer\n");
1159+
ret = -ENOMEM;
11591160
goto release_dev_mem;
11601161
}
11611162

0 commit comments

Comments
 (0)