[PATCH] drm/gem: fix not to assign error value to gem name

2013-06-26 Thread YoungJun Cho
On Jun 26, 2013 5:56 PM, "Chris Wilson"  wrote:
>
> On Wed, Jun 26, 2013 at 10:42:39AM +0900, Seung-Woo Kim wrote:
> > From: YoungJun Cho 
> >
> > If idr_alloc() is failed, obj->name can be error value. Also
> > it cleans up duplicated flink processing code.
>
> You should mention that it is a regression from
> commit 2e928815c (drm: convert to idr_alloc())
>
> > Signed-off-by: YoungJun Cho 
> > Signed-off-by: Seung-Woo Kim 
> > Signed-off-by: Kyungmin Park 
>
> Reviewed-by: Chris Wilson 
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
>

Thank you for comments!
I'll update commit msg.

Best regards YJ
___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
-- next part --
An HTML attachment was scrubbed...
URL: 



[PATCH] drm/gem: fix not to assign error value to gem name

2013-06-26 Thread Seung-Woo Kim
From: YoungJun Cho 

If idr_alloc() is failed, obj->name can be error value. Also
it cleans up duplicated flink processing code.

Signed-off-by: YoungJun Cho 
Signed-off-by: Seung-Woo Kim 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/drm_gem.c |   18 +++---
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index cf919e3..239ef30 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -453,25 +453,21 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
spin_lock(>object_name_lock);
if (!obj->name) {
ret = idr_alloc(>object_name_idr, obj, 1, 0, GFP_NOWAIT);
-   obj->name = ret;
-   args->name = (uint64_t) obj->name;
-   spin_unlock(>object_name_lock);
-   idr_preload_end();
-
if (ret < 0)
goto err;
-   ret = 0;
+
+   obj->name = ret;

/* Allocate a reference for the name table.  */
drm_gem_object_reference(obj);
-   } else {
-   args->name = (uint64_t) obj->name;
-   spin_unlock(>object_name_lock);
-   idr_preload_end();
-   ret = 0;
}

+   args->name = (uint64_t) obj->name;
+   ret = 0;
+
 err:
+   spin_unlock(>object_name_lock);
+   idr_preload_end();
drm_gem_object_unreference_unlocked(obj);
return ret;
 }
-- 
1.7.4.1



[PATCH] drm/gem: fix not to assign error value to gem name

2013-06-26 Thread Chris Wilson
On Wed, Jun 26, 2013 at 10:42:39AM +0900, Seung-Woo Kim wrote:
> From: YoungJun Cho 
> 
> If idr_alloc() is failed, obj->name can be error value. Also
> it cleans up duplicated flink processing code.

You should mention that it is a regression from
commit 2e928815c (drm: convert to idr_alloc())

> Signed-off-by: YoungJun Cho 
> Signed-off-by: Seung-Woo Kim 
> Signed-off-by: Kyungmin Park 

Reviewed-by: Chris Wilson 
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


Re: [PATCH] drm/gem: fix not to assign error value to gem name

2013-06-26 Thread Chris Wilson
On Wed, Jun 26, 2013 at 10:42:39AM +0900, Seung-Woo Kim wrote:
 From: YoungJun Cho yj44@samsung.com
 
 If idr_alloc() is failed, obj-name can be error value. Also
 it cleans up duplicated flink processing code.

You should mention that it is a regression from
commit 2e928815c (drm: convert to idr_alloc())
 
 Signed-off-by: YoungJun Cho yj44@samsung.com
 Signed-off-by: Seung-Woo Kim sw0312@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com

Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/gem: fix not to assign error value to gem name

2013-06-26 Thread YoungJun Cho
On Jun 26, 2013 5:56 PM, Chris Wilson ch...@chris-wilson.co.uk wrote:

 On Wed, Jun 26, 2013 at 10:42:39AM +0900, Seung-Woo Kim wrote:
  From: YoungJun Cho yj44@samsung.com
 
  If idr_alloc() is failed, obj-name can be error value. Also
  it cleans up duplicated flink processing code.

 You should mention that it is a regression from
 commit 2e928815c (drm: convert to idr_alloc())

  Signed-off-by: YoungJun Cho yj44@samsung.com
  Signed-off-by: Seung-Woo Kim sw0312@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com

 Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk
 -Chris

 --
 Chris Wilson, Intel Open Source Technology Centre


Thank you for comments!
I'll update commit msg.

Best regards YJ
___
 dri-devel mailing list
 dri-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/gem: fix not to assign error value to gem name

2013-06-25 Thread Seung-Woo Kim
From: YoungJun Cho yj44@samsung.com

If idr_alloc() is failed, obj-name can be error value. Also
it cleans up duplicated flink processing code.

Signed-off-by: YoungJun Cho yj44@samsung.com
Signed-off-by: Seung-Woo Kim sw0312@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/gpu/drm/drm_gem.c |   18 +++---
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index cf919e3..239ef30 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -453,25 +453,21 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
spin_lock(dev-object_name_lock);
if (!obj-name) {
ret = idr_alloc(dev-object_name_idr, obj, 1, 0, GFP_NOWAIT);
-   obj-name = ret;
-   args-name = (uint64_t) obj-name;
-   spin_unlock(dev-object_name_lock);
-   idr_preload_end();
-
if (ret  0)
goto err;
-   ret = 0;
+
+   obj-name = ret;
 
/* Allocate a reference for the name table.  */
drm_gem_object_reference(obj);
-   } else {
-   args-name = (uint64_t) obj-name;
-   spin_unlock(dev-object_name_lock);
-   idr_preload_end();
-   ret = 0;
}
 
+   args-name = (uint64_t) obj-name;
+   ret = 0;
+
 err:
+   spin_unlock(dev-object_name_lock);
+   idr_preload_end();
drm_gem_object_unreference_unlocked(obj);
return ret;
 }
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel