summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/gamma_dma.c3
-rw-r--r--linux/i810_dma.c3
-rw-r--r--linux/i830_dma.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/linux/gamma_dma.c b/linux/gamma_dma.c
index 6734f1c4..cf25aaba 100644
--- a/linux/gamma_dma.c
+++ b/linux/gamma_dma.c
@@ -673,7 +673,8 @@ int gamma_do_cleanup_dma( drm_device_t *dev )
if ( dev->dev_private ) {
drm_gamma_private_t *dev_priv = dev->dev_private;
- DRM_IOREMAPFREE( dev_priv->buffers );
+ if ( dev_priv->buffers != NULL )
+ DRM_IOREMAPFREE( dev_priv->buffers );
DRM(free)( dev->dev_private, sizeof(drm_gamma_private_t),
DRM_MEM_DRIVER );
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index b0a1b6aa..c06fd915 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -263,7 +263,8 @@ 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;
- DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
+ if ( buf_priv->kernel_virtual && buf->total )
+ DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
}
}
return 0;
diff --git a/linux/i830_dma.c b/linux/i830_dma.c
index 1018fdcb..b76d2b11 100644
--- a/linux/i830_dma.c
+++ b/linux/i830_dma.c
@@ -280,7 +280,8 @@ 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;
- DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
+ if ( buf_priv->kernel_virtual && buf->total )
+ DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total);
}
}
return 0;