Skip to content

Commit

Permalink
drm/i915/buddy: avoid double list_add
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Matthew Auld authored and Chris Wilson committed Mar 6, 2020
1 parent 520f835 commit f4b1b92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/i915_buddy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit f4b1b92

Please sign in to comment.