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

2013-07-01 Thread YoungJun Cho
Hello Chris, On Jul 1, 2013 8:53 PM, "Chris Wilson" wrote: > > On Mon, Jul 01, 2013 at 08:14:42PM +0900, Seung-Woo Kim wrote: > > Hello Chris, > > > > On 2013? 07? 01? 19:57, Chris Wilson wrote: > > > On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: > > >> + > > >> +out_close: > >

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

2013-07-01 Thread Seung-Woo Kim
Hello Chris, On 2013? 07? 01? 19:57, Chris Wilson wrote: > On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: >> + >> +out_close: >> +if (dev->driver->postclose) >> +dev->driver->postclose(dev, priv); >> +out_free: >> kfree(priv); >> filp->private_data =

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

2013-07-01 Thread Seung-Woo Kim
From: YoungJun Cho There are wrong cases 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. And if an error occurs after executing dev->driver->open() which

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

2013-07-01 Thread Chris Wilson
On Mon, Jul 01, 2013 at 08:14:42PM +0900, Seung-Woo Kim wrote: > Hello Chris, > > On 2013? 07? 01? 19:57, Chris Wilson wrote: > > On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: > >> + > >> +out_close: > >> + if (dev->driver->postclose) > >> + dev->driver->postclose(dev,

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

2013-07-01 Thread Chris Wilson
On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: > + > +out_close: > + if (dev->driver->postclose) > + dev->driver->postclose(dev, priv); > +out_free: > kfree(priv); > filp->private_data = NULL; > return ret; Looks like we are also missing: if

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

2013-07-01 Thread Seung-Woo Kim
From: YoungJun Cho yj44@samsung.com There are wrong cases 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. And if an error occurs after executing dev-driver-open() which

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

2013-07-01 Thread Chris Wilson
On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: + +out_close: + if (dev-driver-postclose) + dev-driver-postclose(dev, priv); +out_free: kfree(priv); filp-private_data = NULL; return ret; Looks like we are also missing: if

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

2013-07-01 Thread Seung-Woo Kim
Hello Chris, On 2013년 07월 01일 19:57, Chris Wilson wrote: On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: + +out_close: +if (dev-driver-postclose) +dev-driver-postclose(dev, priv); +out_free: kfree(priv); filp-private_data = NULL; return ret;

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

2013-07-01 Thread Chris Wilson
On Mon, Jul 01, 2013 at 08:14:42PM +0900, Seung-Woo Kim wrote: Hello Chris, On 2013년 07월 01일 19:57, Chris Wilson wrote: On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: + +out_close: + if (dev-driver-postclose) + dev-driver-postclose(dev, priv); +out_free:

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

2013-07-01 Thread YoungJun Cho
Hello Chris, On Jul 1, 2013 8:53 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Mon, Jul 01, 2013 at 08:14:42PM +0900, Seung-Woo Kim wrote: Hello Chris, On 2013년 07월 01일 19:57, Chris Wilson wrote: On Mon, Jul 01, 2013 at 07:49:10PM +0900, Seung-Woo Kim wrote: + +out_close: