]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm/i915: Prevent double unref following alloc failure during execbuffer
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Dec 2013 09:52:58 +0000 (09:52 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 11 Dec 2013 21:21:56 +0000 (22:21 +0100)
commita6b2666f7f833e612e6ecae85a7ac177a861574e
tree73e0a49dacc280dc2119243f0f02c85b88b8a80a
parent6c719faca2aceca72f1bf5b1645c1734ed3e9447
drm/i915: Prevent double unref following alloc failure during execbuffer

Whilst looking up the objects required for an execbuffer, an untimely
allocation failure in creating the vma results in the object being
unreferenced from two lists. The ownership during the lookup is meant to
be moved from the list of objects being looked to the vma, and this
double unreference upon error results in a use-after-free.

Fixes regression from
commit 27173f1f95db5e74ceb35fe9a2f2f348ea11bac9
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Wed Aug 14 11:38:36 2013 +0200

    drm/i915: Convert execbuf code to use vmas

Based on the fix by Ben Widawsky.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: stable@vger.kernel.org
[danvet: Bikeshed the crucial comment above the ownership transfer as
discussed on irc.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_execbuffer.c