summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Castet <castet.matthieu@free.fr>2007-08-22 23:17:56 +0200
committerMatthieu Castet <castet.matthieu@free.fr>2007-08-22 23:20:14 +0200
commit8645dac8952473dc3e09ba7a7a9db3fbdf75215f (patch)
treec7a44062c34a5c5e39927379a8324c201e3ad650
parent11c46afe7599cf3cefd30a7e55325a1a1aa8e5ba (diff)
nouveau : fix some potential crashes with objects causing hash collision
-rw-r--r--shared-core/nouveau_object.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c
index e0cb334f..fbce7702 100644
--- a/shared-core/nouveau_object.c
+++ b/shared-core/nouveau_object.c
@@ -141,8 +141,13 @@ nouveau_ramht_insert(struct drm_device *dev, struct nouveau_gpuobj_ref *ref)
ref->channel, co, INSTANCE_RD(ramht, co/4));
co += 8;
- if (co >= dev_priv->ramht_size)
+ if (co >= dev_priv->ramht_size) {
+ DRM_INFO("no space left after collision\n");
co = 0;
+ /* exit as it seems to cause crash with nouveau_demo and
+ * 0xdead0001 object */
+ break;
+ }
} while (co != ho);
DRM_ERROR("RAMHT space exhausted. ch=%d\n", ref->channel);