drm/ttm: fix missing res assignment in ttm_range_man_alloc
Subsystems (3)
PATCH 1/1 drm/ttm: fix missing res assignment in ttm_range_man_alloc
That somehow got missing.
Signed-off-by Christian König <[email protected]>
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(-)
drivers/gpu/drm/ttm/ttm_range_manager.c +6 -4
@@ -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,
Signature · 1 line
2.25.1
Quoted 4 lines · Christian König
That somehow got missing.
Signed-off-by Christian König <[email protected]>Fixes cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
Reported-by Thomas Hellström <[email protected]>
Reviewed-by Thomas Hellström <[email protected]>
Quoted 27 lines
--- drivers/gpu/drm/ttm/ttm_range_manager.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)drivers/gpu/drm/ttm/ttm_range_manager.c +6
-4@@ -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,