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) --- linux-core/i810_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux-core/i810_dma.c') diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index b0a1b6aa..c06fd915 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/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; -- cgit v1.2.3