From: Chris Wilson Date: Sun, 14 Aug 2016 17:44:40 +0000 (+0100) Subject: drm/i915: Initialize return value for empty i915_gem_object_unbind() X-Git-Tag: v4.9-rc1~41^2~36^2~95 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=35a9611ca0e719557d9a198cb01021b4003198f2;p=karo-tx-linux.git drm/i915: Initialize return value for empty i915_gem_object_unbind() If the obj->vma_list is empty, we immediately return ret. However, we are doing so having never set it to any value, it should be zero! Reported-by: Matthew Auld References: https://bugs.freedesktop.org/show_bug.cgi?id=97343 Fixes: aa653a685d81 ("drm/i915: Be more careful when unbinding vma") Signed-off-by: Chris Wilson Cc: Matthew Auld Link: http://patchwork.freedesktop.org/patch/msgid/1471196681-30043-1-git-send-email-chris@chris-wilson.co.uk Reviewed-by: Matthew Auld --- diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 75a57e2da86e..ac706f31af7d 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -279,12 +279,11 @@ static const struct drm_i915_gem_object_ops i915_gem_phys_ops = { .release = i915_gem_object_release_phys, }; -int -i915_gem_object_unbind(struct drm_i915_gem_object *obj) +int i915_gem_object_unbind(struct drm_i915_gem_object *obj) { struct i915_vma *vma; LIST_HEAD(still_in_list); - int ret; + int ret = 0; /* The vma will only be freed if it is marked as closed, and if we wait * upon rendering to the vma, we may unbind anything in the list.