Skip to content

Commit d337332

Browse files
Dan Carpenterbbrezillon
authored andcommitted
drm/panthor: Fix a couple -ENOMEM error codes
These error paths forgot to set the error code to -ENOMEM. Fixes: 647810e ("drm/panthor: Add the MMU/VM logical block") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent be7ffc8 commit d337332

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/panthor/panthor_mmu.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,10 @@ static int panthor_vm_prepare_map_op_ctx(struct panthor_vm_op_ctx *op_ctx,
12641264
op_ctx->rsvd_page_tables.pages = kcalloc(pt_count,
12651265
sizeof(*op_ctx->rsvd_page_tables.pages),
12661266
GFP_KERNEL);
1267-
if (!op_ctx->rsvd_page_tables.pages)
1267+
if (!op_ctx->rsvd_page_tables.pages) {
1268+
ret = -ENOMEM;
12681269
goto err_cleanup;
1270+
}
12691271

12701272
ret = kmem_cache_alloc_bulk(pt_cache, GFP_KERNEL, pt_count,
12711273
op_ctx->rsvd_page_tables.pages);
@@ -1318,8 +1320,10 @@ static int panthor_vm_prepare_unmap_op_ctx(struct panthor_vm_op_ctx *op_ctx,
13181320
op_ctx->rsvd_page_tables.pages = kcalloc(pt_count,
13191321
sizeof(*op_ctx->rsvd_page_tables.pages),
13201322
GFP_KERNEL);
1321-
if (!op_ctx->rsvd_page_tables.pages)
1323+
if (!op_ctx->rsvd_page_tables.pages) {
1324+
ret = -ENOMEM;
13221325
goto err_cleanup;
1326+
}
13231327

13241328
ret = kmem_cache_alloc_bulk(pt_cache, GFP_KERNEL, pt_count,
13251329
op_ctx->rsvd_page_tables.pages);

0 commit comments

Comments
 (0)