[PATCH v4 3/3] drm: fix error routines in drm_open_helper

Chris Wilson chris at chris-wilson.co.uk
Tue Jul 2 04:19:22 PDT 2013


On Tue, Jul 02, 2013 at 09:53:28AM +0900, Seung-Woo Kim wrote:
> From: YoungJun Cho <yj44.cho at samsung.com>
> 
> 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 at samsung.com>
> Signed-off-by: Seung-Woo Kim <sw0312.kim at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>

I can't see anything else that we setup and miss freeing along the
failed open, so if it compiles ;-)
Reviewed-by: Chris Wilson <chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list