From 9c8d634e687a5a5b5d314b3fd5b34cc17a217139 Mon Sep 17 00:00:00 2001 From: Stuart Bennett Date: Sat, 7 Feb 2009 21:20:17 +0000 Subject: nouveau: don't try to traverse non-existent lists Fixes nouveau_ioctl_mem_free Oops --- shared-core/nouveau_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shared-core/nouveau_mem.c') diff --git a/shared-core/nouveau_mem.c b/shared-core/nouveau_mem.c index 0d590276..74636dc2 100644 --- a/shared-core/nouveau_mem.c +++ b/shared-core/nouveau_mem.c @@ -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; -- cgit v1.2.3