[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 = NULL;

[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 allocates driver specif

[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, p

[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 (drm_

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" 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: > > >

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, p

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;

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 (drm_

[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 allocates driver specif