From db7349534275620016805123311a979a46364769 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Tue, 27 Apr 2021 09:35:17 +0200 Subject: [PATCH] drm/ttm: flip over the sys manager to self allocated nodes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make sure to allocate a resource object here. Signed-off-by: Christian König Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20210602100914.46246-3-christian.koenig@amd.com --- drivers/gpu/drm/ttm/ttm_sys_manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_sys_manager.c b/drivers/gpu/drm/ttm/ttm_sys_manager.c index 474221e..2b75f49 100644 --- a/drivers/gpu/drm/ttm/ttm_sys_manager.c +++ b/drivers/gpu/drm/ttm/ttm_sys_manager.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "ttm_module.h" @@ -11,12 +12,18 @@ static int ttm_sys_man_alloc(struct ttm_resource_manager *man, const struct ttm_place *place, struct ttm_resource *mem) { + mem->mm_node = kzalloc(sizeof(*mem), GFP_KERNEL); + if (!mem->mm_node) + return -ENOMEM; + + ttm_resource_init(bo, place, mem->mm_node); return 0; } static void ttm_sys_man_free(struct ttm_resource_manager *man, struct ttm_resource *mem) { + kfree(mem->mm_node); } static const struct ttm_resource_manager_func ttm_sys_manager_func = { -- 2.7.4