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 <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 3c8a906 commit 47558cb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)