aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2021-06-07 12:39:10 +0200
committerChristian König <christian.koenig@amd.com>2021-06-07 12:50:49 +0200
commit8f8e19bd18b41dae7a9192c29cba9298bafcde10 (patch)
treeca1fd39e3d026789173e0a3c836644f21a746b1b /drivers/gpu/drm/ttm
parentdma-buf: drop the _rcu postfix on function names v3 (diff)
downloadlinux-dev-8f8e19bd18b41dae7a9192c29cba9298bafcde10.tar.xz
linux-dev-8f8e19bd18b41dae7a9192c29cba9298bafcde10.zip
drm/ttm: fix missing res assignment in ttm_range_man_alloc
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
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_range_manager.c10
1 files 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,