]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/ttm: fix missing res assignment in ttm_range_man_alloc
authorChristian König <christian.koenig@amd.com>
Mon, 7 Jun 2021 10:39:10 +0000 (12:39 +0200)
committerChristian König <christian.koenig@amd.com>
Mon, 7 Jun 2021 10:50:49 +0000 (12:50 +0200)
That somehow got missing.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reported-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
Link: https://patchwork.freedesktop.org/patch/msgid/20210607104040.22017-1-christian.koenig@amd.com
drivers/gpu/drm/ttm/ttm_range_manager.c

index c32e1aee2481f3bb4413f05bff9e16983496950e..03395386e8a7cbc8697f53230d26719ef2ca1e5a 100644 (file)
@@ -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,