All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: fix missing res assignment in ttm_range_man_alloc
@ 2021-06-07 10:40 Christian König
  2021-06-07 10:46 ` Thomas Hellström (Intel)
  0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2021-06-07 10:40 UTC (permalink / raw)
  To: dri-devel; +Cc: thomas_os, matthew.auld

That somehow got missing.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
---
 drivers/gpu/drm/ttm/ttm_range_manager.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c
index c32e1aee2481..03395386e8a7 100644
--- a/drivers/gpu/drm/ttm/ttm_range_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_range_manager.c
@@ -88,12 +88,14 @@ static int ttm_range_man_alloc(struct ttm_resource_manager *man,
 					  place->fpfn, lpfn, mode);
 	spin_unlock(&rman->lock);
 
-	if (unlikely(ret))
+	if (unlikely(ret)) {
 		kfree(node);
-	else
-		node->base.start = node->mm_nodes[0].start;
+		return ret;
+	}
 
-	return ret;
+	node->base.start = node->mm_nodes[0].start;
+	*res = &node->base;
+	return 0;
 }
 
 static void ttm_range_man_free(struct ttm_resource_manager *man,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/ttm: fix missing res assignment in ttm_range_man_alloc
  2021-06-07 10:40 [PATCH] drm/ttm: fix missing res assignment in ttm_range_man_alloc Christian König
@ 2021-06-07 10:46 ` Thomas Hellström (Intel)
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Hellström (Intel) @ 2021-06-07 10:46 UTC (permalink / raw)
  To: Christian König, dri-devel; +Cc: matthew.auld


On 6/7/21 12:40 PM, Christian König wrote:
> That somehow got missing.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")

Reported-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


> ---
>   drivers/gpu/drm/ttm/ttm_range_manager.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c
> index c32e1aee2481..03395386e8a7 100644
> --- a/drivers/gpu/drm/ttm/ttm_range_manager.c
> +++ b/drivers/gpu/drm/ttm/ttm_range_manager.c
> @@ -88,12 +88,14 @@ static int ttm_range_man_alloc(struct ttm_resource_manager *man,
>   					  place->fpfn, lpfn, mode);
>   	spin_unlock(&rman->lock);
>   
> -	if (unlikely(ret))
> +	if (unlikely(ret)) {
>   		kfree(node);
> -	else
> -		node->base.start = node->mm_nodes[0].start;
> +		return ret;
> +	}
>   
> -	return ret;
> +	node->base.start = node->mm_nodes[0].start;
> +	*res = &node->base;
> +	return 0;
>   }
>   
>   static void ttm_range_man_free(struct ttm_resource_manager *man,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-07 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 10:40 [PATCH] drm/ttm: fix missing res assignment in ttm_range_man_alloc Christian König
2021-06-07 10:46 ` Thomas Hellström (Intel)

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.