summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-09-09 18:40:34 (GMT)
committerDave Airlie <airlied@linux.ie>2008-10-17 21:10:52 (GMT)
commitd4e7b898c12b2b458323243abdd4a215f8f8f090 (patch)
tree5a6452750b095f7f79cd1751f6796637cbfcf241
parentdbb19d302baa8ba518599701914f600935fc53fa (diff)
downloadlinux-fsl-qoriq-d4e7b898c12b2b458323243abdd4a215f8f8f090.tar.xz
DRM: Return -EBADF on bad object in flink, and return curent name if it exists.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_gem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 434155b..ccd1afd 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -251,7 +251,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
if (obj == NULL)
- return -EINVAL;
+ return -EBADF;
again:
if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0)
@@ -259,8 +259,9 @@ again:
spin_lock(&dev->object_name_lock);
if (obj->name) {
+ args->name = obj->name;
spin_unlock(&dev->object_name_lock);
- return -EEXIST;
+ return 0;
}
ret = idr_get_new_above(&dev->object_name_idr, obj, 1,
&obj->name);