diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_object.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ramht.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ramht.h | 2 |
3 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index 068441c4b563..ce9958a30175 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c | |||
@@ -926,20 +926,14 @@ int nouveau_ioctl_gpuobj_free(struct drm_device *dev, void *data, | |||
926 | struct drm_file *file_priv) | 926 | struct drm_file *file_priv) |
927 | { | 927 | { |
928 | struct drm_nouveau_gpuobj_free *objfree = data; | 928 | struct drm_nouveau_gpuobj_free *objfree = data; |
929 | struct nouveau_gpuobj *gpuobj; | ||
930 | struct nouveau_channel *chan; | 929 | struct nouveau_channel *chan; |
931 | int ret = -ENOENT; | 930 | int ret; |
932 | 931 | ||
933 | chan = nouveau_channel_get(dev, file_priv, objfree->channel); | 932 | chan = nouveau_channel_get(dev, file_priv, objfree->channel); |
934 | if (IS_ERR(chan)) | 933 | if (IS_ERR(chan)) |
935 | return PTR_ERR(chan); | 934 | return PTR_ERR(chan); |
936 | 935 | ||
937 | gpuobj = nouveau_ramht_find(chan, objfree->handle); | 936 | ret = nouveau_ramht_remove(chan, objfree->handle); |
938 | if (gpuobj) { | ||
939 | nouveau_ramht_remove(chan, objfree->handle); | ||
940 | ret = 0; | ||
941 | } | ||
942 | |||
943 | nouveau_channel_put(&chan); | 937 | nouveau_channel_put(&chan); |
944 | return ret; | 938 | return ret; |
945 | } | 939 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c index 2d8580927ca4..b4c63c058888 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ramht.c +++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c | |||
@@ -214,18 +214,19 @@ out: | |||
214 | spin_unlock_irqrestore(&chan->ramht->lock, flags); | 214 | spin_unlock_irqrestore(&chan->ramht->lock, flags); |
215 | } | 215 | } |
216 | 216 | ||
217 | void | 217 | int |
218 | nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) | 218 | nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) |
219 | { | 219 | { |
220 | struct nouveau_ramht_entry *entry; | 220 | struct nouveau_ramht_entry *entry; |
221 | 221 | ||
222 | entry = nouveau_ramht_remove_entry(chan, handle); | 222 | entry = nouveau_ramht_remove_entry(chan, handle); |
223 | if (!entry) | 223 | if (!entry) |
224 | return; | 224 | return -ENOENT; |
225 | 225 | ||
226 | nouveau_ramht_remove_hash(chan, entry->handle); | 226 | nouveau_ramht_remove_hash(chan, entry->handle); |
227 | nouveau_gpuobj_ref(NULL, &entry->gpuobj); | 227 | nouveau_gpuobj_ref(NULL, &entry->gpuobj); |
228 | kfree(entry); | 228 | kfree(entry); |
229 | return 0; | ||
229 | } | 230 | } |
230 | 231 | ||
231 | struct nouveau_gpuobj * | 232 | struct nouveau_gpuobj * |
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.h b/drivers/gpu/drm/nouveau/nouveau_ramht.h index b79cb5e1a8f1..c82de98fee0e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ramht.h +++ b/drivers/gpu/drm/nouveau/nouveau_ramht.h | |||
@@ -48,7 +48,7 @@ extern void nouveau_ramht_ref(struct nouveau_ramht *, struct nouveau_ramht **, | |||
48 | 48 | ||
49 | extern int nouveau_ramht_insert(struct nouveau_channel *, u32 handle, | 49 | extern int nouveau_ramht_insert(struct nouveau_channel *, u32 handle, |
50 | struct nouveau_gpuobj *); | 50 | struct nouveau_gpuobj *); |
51 | extern void nouveau_ramht_remove(struct nouveau_channel *, u32 handle); | 51 | extern int nouveau_ramht_remove(struct nouveau_channel *, u32 handle); |
52 | extern struct nouveau_gpuobj * | 52 | extern struct nouveau_gpuobj * |
53 | nouveau_ramht_find(struct nouveau_channel *chan, u32 handle); | 53 | nouveau_ramht_find(struct nouveau_channel *chan, u32 handle); |
54 | 54 | ||