diff options
author | Leif Delgass <ldelgass@users.sourceforge.net> | 2003-04-21 16:07:17 +0000 |
---|---|---|
committer | Leif Delgass <ldelgass@users.sourceforge.net> | 2003-04-21 16:07:17 +0000 |
commit | 46e06192a88834a97257d2be5ab3aa7c325a1cfe (patch) | |
tree | 3a77c3f79e6415aaff35c6fbd22f256269ced8a0 /shared/r128_cce.c | |
parent | da35a90d99cf56a8ffc48f87754013d13e1cafcd (diff) |
Check for NULL map before calling DRM(ioremapfree) on cleanup. Prevents an
oops if a map wasn't found (e.g. XFree86 Bugzilla #108)
Diffstat (limited to 'shared/r128_cce.c')
-rw-r--r-- | shared/r128_cce.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shared/r128_cce.c b/shared/r128_cce.c index 7f0f43254..ad03f4f9d 100644 --- a/shared/r128_cce.c +++ b/shared/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, |