]> git.baikalelectronics.ru Git - kernel.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>
Thu, 12 Dec 2013 09:44:57 +0000 (10:44 +0100)
commit08abd3cf65b97df4c8ed4327876adacf28acb382
tree2a1885196b61218e8570f7121c44a35bc058f899
parentc3a40c6a399bf38b77ea5fbdb2ed8cd231352567
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 a488bb45e74eae5d6bb3339848fc0d369ee31499
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