Check for NULL map before calling DRM(ioremapfree) on cleanup. Prevents an

oops if a map wasn't found (e.g. XFree86 Bugzilla #108)
main
Leif Delgass 2003-04-21 16:07:17 +00:00
parent da35a90d99
commit 46e06192a8
11 changed files with 46 additions and 23 deletions

View File

@ -263,6 +263,7 @@ static int i810_dma_cleanup(drm_device_t *dev)
for (i = 0; i < dma->buf_count; i++) {
drm_buf_t *buf = dma->buflist[ i ];
drm_i810_buf_priv_t *buf_priv = buf->dev_private;
if ( buf_priv->kernel_virtual && buf->total )
DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
}
}

View File

@ -280,6 +280,7 @@ static int i830_dma_cleanup(drm_device_t *dev)
for (i = 0; i < dma->buf_count; i++) {
drm_buf_t *buf = dma->buflist[ i ];
drm_i830_buf_priv_t *buf_priv = buf->dev_private;
if ( buf_priv->kernel_virtual && buf->total )
DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
}
}

View File

@ -673,6 +673,7 @@ int gamma_do_cleanup_dma( drm_device_t *dev )
if ( dev->dev_private ) {
drm_gamma_private_t *dev_priv = dev->dev_private;
if ( dev_priv->buffers != NULL )
DRM_IOREMAPFREE( dev_priv->buffers );
DRM(free)( dev->dev_private, sizeof(drm_gamma_private_t),

View File

@ -263,6 +263,7 @@ static int i810_dma_cleanup(drm_device_t *dev)
for (i = 0; i < dma->buf_count; i++) {
drm_buf_t *buf = dma->buflist[ i ];
drm_i810_buf_priv_t *buf_priv = buf->dev_private;
if ( buf_priv->kernel_virtual && buf->total )
DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
}
}

View File

@ -280,6 +280,7 @@ static int i830_dma_cleanup(drm_device_t *dev)
for (i = 0; i < dma->buf_count; i++) {
drm_buf_t *buf = dma->buflist[ i ];
drm_i830_buf_priv_t *buf_priv = buf->dev_private;
if ( buf_priv->kernel_virtual && buf->total )
DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
}
}

View File

@ -642,8 +642,11 @@ int mga_do_cleanup_dma( drm_device_t *dev )
if ( dev->dev_private ) {
drm_mga_private_t *dev_priv = dev->dev_private;
if ( dev_priv->warp != NULL )
DRM_IOREMAPFREE( dev_priv->warp );
if ( dev_priv->primary != NULL )
DRM_IOREMAPFREE( dev_priv->primary );
if ( dev_priv->buffers != NULL )
DRM_IOREMAPFREE( dev_priv->buffers );
if ( dev_priv->head != NULL ) {

View File

@ -619,8 +619,11 @@ int r128_do_cleanup_cce( drm_device_t *dev )
#if __REALLY_HAVE_SG
if ( !dev_priv->is_pci ) {
#endif
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 {

View File

@ -1279,8 +1279,11 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
drm_radeon_private_t *dev_priv = dev->dev_private;
if ( !dev_priv->is_pci ) {
if ( dev_priv->cp_ring != NULL )
DRM_IOREMAPFREE( dev_priv->cp_ring );
if ( dev_priv->ring_rptr != NULL )
DRM_IOREMAPFREE( dev_priv->ring_rptr );
if ( dev_priv->buffers != NULL )
DRM_IOREMAPFREE( dev_priv->buffers );
} else {
#if __REALLY_HAVE_SG

View File

@ -642,8 +642,11 @@ int mga_do_cleanup_dma( drm_device_t *dev )
if ( dev->dev_private ) {
drm_mga_private_t *dev_priv = dev->dev_private;
if ( dev_priv->warp != NULL )
DRM_IOREMAPFREE( dev_priv->warp );
if ( dev_priv->primary != NULL )
DRM_IOREMAPFREE( dev_priv->primary );
if ( dev_priv->buffers != NULL )
DRM_IOREMAPFREE( dev_priv->buffers );
if ( dev_priv->head != NULL ) {

View File

@ -619,8 +619,11 @@ int r128_do_cleanup_cce( drm_device_t *dev )
#if __REALLY_HAVE_SG
if ( !dev_priv->is_pci ) {
#endif
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 {

View File

@ -1279,8 +1279,11 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
drm_radeon_private_t *dev_priv = dev->dev_private;
if ( !dev_priv->is_pci ) {
if ( dev_priv->cp_ring != NULL )
DRM_IOREMAPFREE( dev_priv->cp_ring );
if ( dev_priv->ring_rptr != NULL )
DRM_IOREMAPFREE( dev_priv->ring_rptr );
if ( dev_priv->buffers != NULL )
DRM_IOREMAPFREE( dev_priv->buffers );
} else {
#if __REALLY_HAVE_SG