diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-09-21 14:04:18 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-09-21 15:32:34 -0400 |
commit | 47cc140931cc03076014fdbfdd512d6dd9d74d34 (patch) | |
tree | 14998b3aee870ed85a732541164aecd6b213ec9c /drivers/char/drm/drm_hashtab.c | |
parent | 9b1a51b69c89028f18277e235533c160e7506ebb (diff) |
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/char/drm/drm_hashtab.c')
-rw-r--r-- | drivers/char/drm/drm_hashtab.c | 6 |
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) | |||
106 | hlist_for_each(list, h_list) { | 106 | hlist_for_each(list, h_list) { |
107 | entry = hlist_entry(list, drm_hash_item_t, head); | 107 | entry = hlist_entry(list, drm_hash_item_t, head); |
108 | if (entry->key == key) | 108 | if (entry->key == key) |
109 | return -1; | 109 | return -EINVAL; |
110 | if (entry->key > key) | 110 | if (entry->key > key) |
111 | break; | 111 | break; |
112 | parent = list; | 112 | parent = list; |
@@ -154,7 +154,7 @@ int drm_ht_find_item(drm_open_hash_t *ht, unsigned long key, | |||
154 | 154 | ||
155 | list = drm_ht_find_key(ht, key); | 155 | list = drm_ht_find_key(ht, key); |
156 | if (!list) | 156 | if (!list) |
157 | return -1; | 157 | return -EINVAL; |
158 | 158 | ||
159 | *item = hlist_entry(list, drm_hash_item_t, head); | 159 | *item = hlist_entry(list, drm_hash_item_t, head); |
160 | return 0; | 160 | return 0; |
@@ -170,7 +170,7 @@ int drm_ht_remove_key(drm_open_hash_t *ht, unsigned long key) | |||
170 | ht->fill--; | 170 | ht->fill--; |
171 | return 0; | 171 | return 0; |
172 | } | 172 | } |
173 | return -1; | 173 | return -EINVAL; |
174 | } | 174 | } |
175 | 175 | ||
176 | int drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item) | 176 | int drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item) |