drm/i915: Unref context on failed eb_create
authorBen Widawsky <benjamin.widawsky@intel.com>
Sat, 5 Apr 2014 05:41:07 +0000 (22:41 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 9 Apr 2014 12:37:11 +0000 (14:37 +0200)
I opted to do this instead of grabbing the context reference after
eb_create since eb_create can potentially call the shrinker, and that
makes things very complicated. This simple patch balances the ref count
without requiring a great deal of review to make sure the shrinker path
is safe.

Theoretically (by design) the shrinker can end up destroying a context,
which enforces the reasoning for doing the fix this way instead of
moving the reference to later in the function.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

No differences found