summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-21 20:04:18 +0200
committerDave Airlie <airlied@linux.ie>2006-09-21 21:32:34 +0200
commit47cc140931cc03076014fdbfdd512d6dd9d74d34 (patch)
tree14998b3aee870ed85a732541164aecd6b213ec9c /drivers
parentdrm: domain changes broke ppc r200 (diff)
downloadlinux-47cc140931cc03076014fdbfdd512d6dd9d74d34.tar.xz
linux-47cc140931cc03076014fdbfdd512d6dd9d74d34.zip
drm: Fix hashtab implementation leaking illegal error codes to user space.
reported by Dave Airlie Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/drm/drm_hashtab.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/drm/drm_hashtab.c b/drivers/char/drm/drm_hashtab.c
index 480611395481..a0b2d6802ae4 100644
--- a/drivers/char/drm/drm_hashtab.c
+++ b/drivers/char/drm/drm_hashtab.c
@@ -106,7 +106,7 @@ int drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item)
hlist_for_each(list, h_list) {
entry = hlist_entry(list, drm_hash_item_t, head);
if (entry->key == key)
- return -1;
+ return -EINVAL;
if (entry->key > key)
break;
parent = list;
@@ -154,7 +154,7 @@ int drm_ht_find_item(drm_open_hash_t *ht, unsigned long key,
list = drm_ht_find_key(ht, key);
if (!list)
- return -1;
+ return -EINVAL;
*item = hlist_entry(list, drm_hash_item_t, head);
return 0;
@@ -170,7 +170,7 @@ int drm_ht_remove_key(drm_open_hash_t *ht, unsigned long key)
ht->fill--;
return 0;
}
- return -1;
+ return -EINVAL;
}
int drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item)