* [PATCH 1/1] drm/amdgpu: Free user pages if kvmalloc_array fails
@ 2022-04-29 0:29 Philip Yang
2022-04-29 8:43 ` Christian König
2022-04-29 14:06 ` Felix Kuehling
0 siblings, 2 replies; 3+ messages in thread
From: Philip Yang @ 2022-04-29 0:29 UTC (permalink / raw)
To: amd-gfx; +Cc: ckoenig.leichtzumerken, Felix.Kuehling, Philip Yang
To cleanup the BOs of bo_list which have got user pages.
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 44dcbef80229..ccde951244f5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -543,7 +543,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
GFP_KERNEL | __GFP_ZERO);
if (!e->user_pages) {
DRM_ERROR("kvmalloc_array failure\n");
- return -ENOMEM;
+ r = -ENOMEM;
+ goto out_free_user_pages;
}
r = amdgpu_ttm_tt_get_user_pages(bo, e->user_pages);
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] drm/amdgpu: Free user pages if kvmalloc_array fails
2022-04-29 0:29 [PATCH 1/1] drm/amdgpu: Free user pages if kvmalloc_array fails Philip Yang
@ 2022-04-29 8:43 ` Christian König
2022-04-29 14:06 ` Felix Kuehling
1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2022-04-29 8:43 UTC (permalink / raw)
To: Philip Yang, amd-gfx; +Cc: Felix.Kuehling
Am 29.04.22 um 02:29 schrieb Philip Yang:
> To cleanup the BOs of bo_list which have got user pages.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 44dcbef80229..ccde951244f5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -543,7 +543,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> GFP_KERNEL | __GFP_ZERO);
> if (!e->user_pages) {
> DRM_ERROR("kvmalloc_array failure\n");
> - return -ENOMEM;
> + r = -ENOMEM;
> + goto out_free_user_pages;
> }
>
> r = amdgpu_ttm_tt_get_user_pages(bo, e->user_pages);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] drm/amdgpu: Free user pages if kvmalloc_array fails
2022-04-29 0:29 [PATCH 1/1] drm/amdgpu: Free user pages if kvmalloc_array fails Philip Yang
2022-04-29 8:43 ` Christian König
@ 2022-04-29 14:06 ` Felix Kuehling
1 sibling, 0 replies; 3+ messages in thread
From: Felix Kuehling @ 2022-04-29 14:06 UTC (permalink / raw)
To: Philip Yang, amd-gfx; +Cc: ckoenig.leichtzumerken
Am 2022-04-28 um 20:29 schrieb Philip Yang:
> To cleanup the BOs of bo_list which have got user pages.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Thanks,
Felix
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 44dcbef80229..ccde951244f5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -543,7 +543,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> GFP_KERNEL | __GFP_ZERO);
> if (!e->user_pages) {
> DRM_ERROR("kvmalloc_array failure\n");
> - return -ENOMEM;
> + r = -ENOMEM;
> + goto out_free_user_pages;
> }
>
> r = amdgpu_ttm_tt_get_user_pages(bo, e->user_pages);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-29 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 0:29 [PATCH 1/1] drm/amdgpu: Free user pages if kvmalloc_array fails Philip Yang
2022-04-29 8:43 ` Christian König
2022-04-29 14:06 ` Felix Kuehling
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.