drm/panthor: Fix a couple -ENOMEM error codes
Subsystems (4)
PATCH 1/1 drm/panthor: Fix a couple -ENOMEM error codes
These error paths forgot to set the error code to -ENOMEM.
Fixes 647810ec2476 ("drm/panthor: Add the MMU/VM logical block")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/panthor/panthor_mmu.c +6 -2
@@ -1264,8 +1264,10 @@ static int panthor_vm_prepare_map_op_ctx(struct panthor_vm_op_ctx *op_ctx, op_ctx->rsvd_page_tables.pages =kcalloc (pt_count,sizeof (*op_ctx->rsvd_page_tables.pages),GFP_KERNEL ); -if (!op_ctx->rsvd_page_tables.pages) +if (!op_ctx->rsvd_page_tables.pages) { + ret = -ENOMEM ; goto err_cleanup; + } ret =kmem_cache_alloc_bulk (pt_cache,GFP_KERNEL , pt_count, 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, op_ctx->rsvd_page_tables.pages =kcalloc (pt_count,sizeof (*op_ctx->rsvd_page_tables.pages),GFP_KERNEL ); -if (!op_ctx->rsvd_page_tables.pages) +if (!op_ctx->rsvd_page_tables.pages) { + ret = -ENOMEM ; goto err_cleanup; + } ret =kmem_cache_alloc_bulk (pt_cache,GFP_KERNEL , pt_count, op_ctx->rsvd_page_tables.pages);
Signature · 1 line
2.43.0
Quoted 4 lines · On Tue, 2 Apr 2024 12:58:09 +0300 Dan Carpenter <[email protected]>…
These error paths forgot to set the error code to
-ENOMEM.Fixes 647810ec2476 ("drm/panthor: Add the MMU/VM logical block")Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by Boris Brezillon <[email protected]>
Quoted 32 lines
--- drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/panthor/panthor_mmu.c +6
-2@@ -1264,8 +1264,10 @@ static int panthor_vm_prepare_map_op_ctx(struct panthor_vm_op_ctx *op_ctx, op_ctx->rsvd_page_tables.pages =kcalloc (pt_count,sizeof (*op_ctx->rsvd_page_tables.pages),GFP_KERNEL ); -if (!op_ctx->rsvd_page_tables.pages) +if (!op_ctx->rsvd_page_tables.pages) { + ret = -ENOMEM ; goto err_cleanup; + } ret =kmem_cache_alloc_bulk (pt_cache,GFP_KERNEL , pt_count, 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, op_ctx->rsvd_page_tables.pages =kcalloc (pt_count,sizeof (*op_ctx->rsvd_page_tables.pages),GFP_KERNEL ); -if (!op_ctx->rsvd_page_tables.pages) +if (!op_ctx->rsvd_page_tables.pages) { + ret = -ENOMEM ; goto err_cleanup; + } ret =kmem_cache_alloc_bulk (pt_cache,GFP_KERNEL , pt_count, op_ctx->rsvd_page_tables.pages);
Quoted 4 lines · On Tue, 2 Apr 2024 12:58:09 +0300 Dan Carpenter <[email protected]>…
These error paths forgot to set the error code to
-ENOMEM.Fixes 647810ec2476 ("drm/panthor: Add the MMU/VM logical block")Signed-off-by Dan Carpenter <[email protected]>
Queued to drm-misc-next.
Thanks,
Boris
Quoted 32 lines
--- drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/panthor/panthor_mmu.c +6
-2@@ -1264,8 +1264,10 @@ static int panthor_vm_prepare_map_op_ctx(struct panthor_vm_op_ctx *op_ctx, op_ctx->rsvd_page_tables.pages =kcalloc (pt_count,sizeof (*op_ctx->rsvd_page_tables.pages),GFP_KERNEL ); -if (!op_ctx->rsvd_page_tables.pages) +if (!op_ctx->rsvd_page_tables.pages) { + ret = -ENOMEM ; goto err_cleanup; + } ret =kmem_cache_alloc_bulk (pt_cache,GFP_KERNEL , pt_count, 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, op_ctx->rsvd_page_tables.pages =kcalloc (pt_count,sizeof (*op_ctx->rsvd_page_tables.pages),GFP_KERNEL ); -if (!op_ctx->rsvd_page_tables.pages) +if (!op_ctx->rsvd_page_tables.pages) { + ret = -ENOMEM ; goto err_cleanup; + } ret =kmem_cache_alloc_bulk (pt_cache,GFP_KERNEL , pt_count, op_ctx->rsvd_page_tables.pages);