aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-09-02 20:25:02 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-09-24 02:23:54 -0400
commit2941482ead0b02c9efd81fc3862be3ebfce607a5 (patch)
tree97f89410377a8b5d7dc6f97df64f0fbb7e404593
parent185abeccabe5aed0ef79e8572c3916ea08034a45 (diff)
drm/nouveau: protect ramht_find() from oopsing if on channel without ramht
This doesn't actually happen now, but there's a test case for an earlier kernel where a GPU error is signalled on one of nv50's fake channels, and the ramht lookup by the IRQ handler triggered an oops. This adds a check for RAMHT's existance on a channel before looking up an object handle. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ramht.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c
index de34b6bb059f..f240ba241943 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ramht.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c
@@ -197,6 +197,9 @@ nouveau_ramht_find(struct nouveau_channel *chan, u32 handle)
197 struct nouveau_gpuobj *gpuobj = NULL; 197 struct nouveau_gpuobj *gpuobj = NULL;
198 unsigned long flags; 198 unsigned long flags;
199 199
200 if (unlikely(!chan->ramht))
201 return NULL;
202
200 spin_lock_irqsave(&ramht->lock, flags); 203 spin_lock_irqsave(&ramht->lock, flags);
201 list_for_each_entry(entry, &chan->ramht->entries, head) { 204 list_for_each_entry(entry, &chan->ramht->entries, head) {
202 if (entry->channel == chan && entry->handle == handle) { 205 if (entry->channel == chan && entry->handle == handle) {