* [PATCH] drm/panthor: Fix a couple -ENOMEM error codes
@ 2024-04-02 9:58 Dan Carpenter
2024-04-02 12:21 ` Boris Brezillon
2024-04-03 7:16 ` Boris Brezillon
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-04-02 9:58 UTC (permalink / raw)
To: Boris Brezillon
Cc: Steven Price, Liviu Dudau, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Grant Likely,
Heiko Stuebner, dri-devel, linux-kernel, kernel-janitors
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 <dan.carpenter@linaro.org>
---
drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
index fdd35249169f..a26b40aab261 100644
--- a/drivers/gpu/drm/panthor/panthor_mmu.c
+++ b/drivers/gpu/drm/panthor/panthor_mmu.c
@@ -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);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panthor: Fix a couple -ENOMEM error codes
2024-04-02 9:58 [PATCH] drm/panthor: Fix a couple -ENOMEM error codes Dan Carpenter
@ 2024-04-02 12:21 ` Boris Brezillon
2024-04-03 7:16 ` Boris Brezillon
1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2024-04-02 12:21 UTC (permalink / raw)
To: Dan Carpenter
Cc: Steven Price, Liviu Dudau, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Grant Likely,
Heiko Stuebner, dri-devel, linux-kernel, kernel-janitors
On Tue, 2 Apr 2024 12:58:09 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:
> 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 <dan.carpenter@linaro.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
> index fdd35249169f..a26b40aab261 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.c
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.c
> @@ -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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panthor: Fix a couple -ENOMEM error codes
2024-04-02 9:58 [PATCH] drm/panthor: Fix a couple -ENOMEM error codes Dan Carpenter
2024-04-02 12:21 ` Boris Brezillon
@ 2024-04-03 7:16 ` Boris Brezillon
1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2024-04-03 7:16 UTC (permalink / raw)
To: Dan Carpenter
Cc: Steven Price, Liviu Dudau, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Grant Likely,
Heiko Stuebner, dri-devel, linux-kernel, kernel-janitors
On Tue, 2 Apr 2024 12:58:09 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:
> 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 <dan.carpenter@linaro.org>
Queued to drm-misc-next.
Thanks,
Boris
> ---
> drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
> index fdd35249169f..a26b40aab261 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.c
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.c
> @@ -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);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-03 7:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02 9:58 [PATCH] drm/panthor: Fix a couple -ENOMEM error codes Dan Carpenter
2024-04-02 12:21 ` Boris Brezillon
2024-04-03 7:16 ` Boris Brezillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox