drm: fix error routines in drm_open_helper
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 2 Jul 2013 00:53:28 +0000 (09:53 +0900)
committerDave Airlie <airlied@redhat.com>
Thu, 4 Jul 2013 00:53:37 +0000 (10:53 +1000)
commitdf9b6a9c3333a99d4483e92ca6b225b335567313
treef0478c4990796a3843cb863e66c884a5d10f2e80
parentfe2ef780669d9bbd2f921b247dc79266b00b99ab
drm: fix error routines in drm_open_helper

There are missing parts to handle error in drm_open_helper().
The priv->minor, assigned by idr_find() which can return NULL,
should be checked whether it is NULL or not before referencing it.
put_pid(), drm_gem_release(), and drm_prime_destory_file_private()
should be called when error happens after their pair functions are
called. If an error occurs after executing dev->driver->open()
which allocates driver specific per-file private data, then the
private data should be released.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Chris Wilson <chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_fops.c