[PATCH] drm/ttm: fix missing res assignment in ttm_range_man_alloc

Thomas Hellström (Intel) thomas_os at shipmail.org
Mon Jun 7 10:46:06 UTC 2021


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

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

Reviewed-by: Thomas Hellström <thomas.hellstrom at 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,


More information about the dri-devel mailing list