Skip to content

Commit

Permalink
drm/ttm: fix missing res assignment in ttm_range_man_alloc
Browse files Browse the repository at this point in the history
That somehow got missing.

Signed-off-by: Christian König <[email protected]>
Reported-by: Thomas Hellström <[email protected]>
Reviewed-by: Thomas Hellström <[email protected]>
Fixes: cb1c814 ("drm/ttm: flip the switch for driver allocated resources v2")
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ChristianKoenigAMD committed Jun 7, 2021
1 parent d3fae3b commit 8f8e19b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/gpu/drm/ttm/ttm_range_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8f8e19b

Please sign in to comment.