Skip to content

Commit

Permalink
drm/nouveau: protect ramht_find() from oopsing if on channel without …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Ben Skeggs committed Sep 24, 2010
1 parent 185abec commit 2941482
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/nouveau/nouveau_ramht.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ nouveau_ramht_find(struct nouveau_channel *chan, u32 handle)
struct nouveau_gpuobj *gpuobj = NULL;
unsigned long flags;

if (unlikely(!chan->ramht))
return NULL;

spin_lock_irqsave(&ramht->lock, flags);
list_for_each_entry(entry, &chan->ramht->entries, head) {
if (entry->channel == chan && entry->handle == handle) {
Expand Down

0 comments on commit 2941482

Please sign in to comment.