From 46e06192a88834a97257d2be5ab3aa7c325a1cfe Mon Sep 17 00:00:00 2001 From: Leif Delgass Date: Mon, 21 Apr 2003 16:07:17 +0000 Subject: Check for NULL map before calling DRM(ioremapfree) on cleanup. Prevents an oops if a map wasn't found (e.g. XFree86 Bugzilla #108) --- shared-core/r128_cce.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'shared-core/r128_cce.c') diff --git a/shared-core/r128_cce.c b/shared-core/r128_cce.c index 7f0f4325..ad03f4f9 100644 --- a/shared-core/r128_cce.c +++ b/shared-core/r128_cce.c @@ -619,9 +619,12 @@ int r128_do_cleanup_cce( drm_device_t *dev ) #if __REALLY_HAVE_SG if ( !dev_priv->is_pci ) { #endif - DRM_IOREMAPFREE( dev_priv->cce_ring ); - DRM_IOREMAPFREE( dev_priv->ring_rptr ); - DRM_IOREMAPFREE( dev_priv->buffers ); + if ( dev_priv->cce_ring != NULL ) + DRM_IOREMAPFREE( dev_priv->cce_ring ); + if ( dev_priv->ring_rptr != NULL ) + DRM_IOREMAPFREE( dev_priv->ring_rptr ); + if ( dev_priv->buffers != NULL ) + DRM_IOREMAPFREE( dev_priv->buffers ); #if __REALLY_HAVE_SG } else { if (!DRM(ati_pcigart_cleanup)( dev, -- cgit v1.2.3