drm/i915: use after free on error path
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 19 Jul 2013 05:46:27 +0000 (08:46 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Jul 2013 06:58:42 +0000 (08:58 +0200)
i915_gem_vma_destroy() frees its argument so we have to move the
drm_mm_remove_node() call up a few lines.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c

index 56642d8eb93735af9b3b4a299bde24ee16190892..ce043f14eab93ca542792bd13adbfbb48676321d 100644 (file)
@@ -3182,9 +3182,9 @@ search_free:
        return 0;
 
 err_out:
+       drm_mm_remove_node(&vma->node);
        i915_gem_vma_destroy(vma);
        i915_gem_object_unpin_pages(obj);
-       drm_mm_remove_node(&vma->node);
        return ret;
 }