mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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>
This commit is contained in:
parent
dbb19d302b
commit
d4e7b898c1
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue