drm: Balance error path for GEM handle allocation
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 9 May 2016 18:01:27 +0000 (12:01 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:47 +0000 (08:27 +0200)
commite0df9595ca96607755a04929a7e9df665de01181
treecba1b127855239e5ecafa3e371dc876d31846eae
parent1db396648ca33eb92dd0ed5cc2ea2f58816eeb9a
drm: Balance error path for GEM handle allocation

[ Upstream commit 6984128d01cf935820a0563f3a00c6623ba58109 ]

The current error path for failure when establishing a handle for a GEM
object is unbalance, e.g. we call object_close() without calling first
object_open(). Use the typical onion structure to only undo what has
been set up prior to the error.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_gem.c