diff options
-rw-r--r-- | drivers/char/drm/drm_bufs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 03c6db9029cf..029baea33b62 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c | |||
@@ -77,14 +77,16 @@ static int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash, | |||
77 | #error Unsupported long size. Neither 64 nor 32 bits. | 77 | #error Unsupported long size. Neither 64 nor 32 bits. |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | if (use_hashed_handle) { | 80 | if (!use_hashed_handle) { |
81 | return drm_ht_just_insert_please(&dev->map_hash, hash, | 81 | int ret; |
82 | user_token, 32 - PAGE_SHIFT - 3, | ||
83 | PAGE_SHIFT, DRM_MAP_HASH_OFFSET); | ||
84 | } else { | ||
85 | hash->key = user_token; | 82 | hash->key = user_token; |
86 | return drm_ht_insert_item(&dev->map_hash, hash); | 83 | ret = drm_ht_insert_item(&dev->map_hash, hash); |
84 | if (ret != -EINVAL) | ||
85 | return ret; | ||
87 | } | 86 | } |
87 | return drm_ht_just_insert_please(&dev->map_hash, hash, | ||
88 | user_token, 32 - PAGE_SHIFT - 3, | ||
89 | PAGE_SHIFT, DRM_MAP_HASH_OFFSET); | ||
88 | } | 90 | } |
89 | 91 | ||
90 | /** | 92 | /** |