diff options
author | Matthew Auld <matthew.auld@intel.com> | 2020-03-05 23:47:10 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-06 17:33:08 +0300 |
commit | f4b1b92f411ea491954de9f803d693d943deb39c (patch) | |
tree | 996d77e276b5dc2578a26a059ed088fd088373f9 | |
parent | 520f8350364dc0f1cfcb82360f9e22400dd7887d (diff) | |
download | linux-f4b1b92f411ea491954de9f803d693d943deb39c.tar.xz |
drm/i915/buddy: avoid double list_add
Be careful not to mark an already free node as free again.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305204711.217783-1-matthew.auld@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/i915_buddy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c index 66883af64ca1..20babbdb297d 100644 --- a/drivers/gpu/drm/i915/i915_buddy.c +++ b/drivers/gpu/drm/i915/i915_buddy.c @@ -312,7 +312,8 @@ i915_buddy_alloc(struct i915_buddy_mm *mm, unsigned int order) return block; out_free: - __i915_buddy_free(mm, block); + if (i != order) + __i915_buddy_free(mm, block); return ERR_PTR(err); } |