nouveau: don't try to traverse non-existent lists

Fixes nouveau_ioctl_mem_free Oops
This commit is contained in:
Stuart Bennett 2009-02-07 21:20:17 +00:00
parent 97fdadee6a
commit 9c8d634e68

View file

@ -809,11 +809,11 @@ nouveau_ioctl_mem_free(struct drm_device *dev, void *data,
memfree->offset -= 512*1024*1024;
block=NULL;
if (memfree->flags & NOUVEAU_MEM_FB)
if (dev_priv->fb_heap && memfree->flags & NOUVEAU_MEM_FB)
block = find_block(dev_priv->fb_heap, memfree->offset);
else if (memfree->flags & NOUVEAU_MEM_AGP)
else if (dev_priv->agp_heap && memfree->flags & NOUVEAU_MEM_AGP)
block = find_block(dev_priv->agp_heap, memfree->offset);
else if (memfree->flags & NOUVEAU_MEM_PCI)
else if (dev_priv->pci_heap && memfree->flags & NOUVEAU_MEM_PCI)
block = find_block(dev_priv->pci_heap, memfree->offset);
if (!block)
return -EFAULT;