summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-06-03 22:45:21 +0000
committerIan Romanick <idr@us.ibm.com>2005-06-03 22:45:21 +0000
commit8e7c130ef71b6300a99f6404d23e7ff8646066be (patch)
treec81276d52904f79ae5b198e3d70e169e62aff3a0 /shared-core
parent9cad6fb4e043ba6140d4c61f09ca0cf0ba8d18c0 (diff)
Move the deallocation of dev_private. Since dev_private is allocated when
the driver is loaded and is always expected to be around, it should only be deallocated when the driver is unloaded. Xorg bug: #3408 Reported by: Chris Rankin
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/mga_dma.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/shared-core/mga_dma.c b/shared-core/mga_dma.c
index 2adb30ac..367c670e 100644
--- a/shared-core/mga_dma.c
+++ b/shared-core/mga_dma.c
@@ -572,10 +572,6 @@ static int mga_do_cleanup_dma(drm_device_t * dev)
if (dev_priv->head != NULL) {
mga_freelist_cleanup(dev);
}
-
- drm_free(dev->dev_private, sizeof(drm_mga_private_t),
- DRM_MEM_DRIVER);
- dev->dev_private = NULL;
}
return 0;
@@ -723,7 +719,17 @@ int mga_dma_buffers(DRM_IOCTL_ARGS)
int mga_driver_postcleanup(drm_device_t * dev)
{
- return mga_do_cleanup_dma(dev);
+ int err;
+
+
+ err = mga_do_cleanup_dma(dev);
+ if (!err) {
+ drm_free(dev->dev_private, sizeof(drm_mga_private_t),
+ DRM_MEM_DRIVER);
+ dev->dev_private = NULL;
+ }
+
+ return err;
}
int mga_driver_dma_quiescent(drm_device_t * dev)