set pointers to NULL after freeing, remove some extra debugging
parent
5c9ed83094
commit
7fe4f60768
|
@ -993,8 +993,10 @@ int mach64_do_cleanup_dma( drm_device_t *dev )
|
|||
drm_core_ioremapfree( dev_priv->ring_map, dev );
|
||||
}
|
||||
|
||||
if ( dev->agp_buffer_map )
|
||||
if ( dev->agp_buffer_map ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
|
||||
mach64_destroy_freelist( dev );
|
||||
|
||||
|
|
|
@ -645,8 +645,10 @@ int mga_do_cleanup_dma( drm_device_t *dev )
|
|||
drm_core_ioremapfree( dev_priv->warp, dev );
|
||||
if ( dev_priv->primary != NULL )
|
||||
drm_core_ioremapfree( dev_priv->primary, dev );
|
||||
if ( dev->agp_buffer_map != NULL )
|
||||
if ( dev->agp_buffer_map != NULL ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
|
||||
if ( dev_priv->head != NULL ) {
|
||||
mga_freelist_cleanup( dev );
|
||||
|
|
|
@ -603,8 +603,10 @@ int r128_do_cleanup_cce( drm_device_t *dev )
|
|||
drm_core_ioremapfree( dev_priv->cce_ring, dev );
|
||||
if ( dev_priv->ring_rptr != NULL )
|
||||
drm_core_ioremapfree( dev_priv->ring_rptr, dev );
|
||||
if ( dev->agp_buffer_map != NULL )
|
||||
if ( dev->agp_buffer_map != NULL ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
|
|
@ -1267,12 +1267,18 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
|
|||
|
||||
#if __REALLY_HAVE_AGP
|
||||
if (dev_priv->flags & CHIP_IS_AGP) {
|
||||
if ( dev_priv->cp_ring != NULL )
|
||||
if ( dev_priv->cp_ring != NULL ) {
|
||||
drm_core_ioremapfree( dev_priv->cp_ring, dev );
|
||||
if ( dev_priv->ring_rptr != NULL )
|
||||
dev_priv->cp_ring = NULL;
|
||||
}
|
||||
if ( dev_priv->ring_rptr != NULL ) {
|
||||
drm_core_ioremapfree( dev_priv->ring_rptr, dev );
|
||||
if ( dev->agp_buffer_map != NULL )
|
||||
dev_priv->ring_rptr = NULL;
|
||||
}
|
||||
if ( dev->agp_buffer_map != NULL ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
@ -1424,7 +1430,6 @@ void radeon_do_release( drm_device_t *dev )
|
|||
{
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
int ret;
|
||||
DRM_DEBUG("dev_priv %ptr\n", dev_priv);
|
||||
|
||||
if (dev_priv) {
|
||||
|
||||
|
@ -1761,7 +1766,6 @@ int radeon_preinit( struct drm_device *dev, unsigned long flags )
|
|||
dev_priv = DRM(alloc)( sizeof(drm_radeon_private_t), DRM_MEM_DRIVER );
|
||||
if ( dev_priv == NULL )
|
||||
return DRM_ERR(ENOMEM);
|
||||
DRM_DEBUG("dev_priv %ptr\n", dev_priv);
|
||||
|
||||
memset( dev_priv, 0, sizeof(drm_radeon_private_t) );
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
|
|
|
@ -993,8 +993,10 @@ int mach64_do_cleanup_dma( drm_device_t *dev )
|
|||
drm_core_ioremapfree( dev_priv->ring_map, dev );
|
||||
}
|
||||
|
||||
if ( dev->agp_buffer_map )
|
||||
if ( dev->agp_buffer_map ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
|
||||
mach64_destroy_freelist( dev );
|
||||
|
||||
|
|
|
@ -645,8 +645,10 @@ int mga_do_cleanup_dma( drm_device_t *dev )
|
|||
drm_core_ioremapfree( dev_priv->warp, dev );
|
||||
if ( dev_priv->primary != NULL )
|
||||
drm_core_ioremapfree( dev_priv->primary, dev );
|
||||
if ( dev->agp_buffer_map != NULL )
|
||||
if ( dev->agp_buffer_map != NULL ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
|
||||
if ( dev_priv->head != NULL ) {
|
||||
mga_freelist_cleanup( dev );
|
||||
|
|
|
@ -603,8 +603,10 @@ int r128_do_cleanup_cce( drm_device_t *dev )
|
|||
drm_core_ioremapfree( dev_priv->cce_ring, dev );
|
||||
if ( dev_priv->ring_rptr != NULL )
|
||||
drm_core_ioremapfree( dev_priv->ring_rptr, dev );
|
||||
if ( dev->agp_buffer_map != NULL )
|
||||
if ( dev->agp_buffer_map != NULL ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
|
|
@ -1267,12 +1267,18 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
|
|||
|
||||
#if __REALLY_HAVE_AGP
|
||||
if (dev_priv->flags & CHIP_IS_AGP) {
|
||||
if ( dev_priv->cp_ring != NULL )
|
||||
if ( dev_priv->cp_ring != NULL ) {
|
||||
drm_core_ioremapfree( dev_priv->cp_ring, dev );
|
||||
if ( dev_priv->ring_rptr != NULL )
|
||||
dev_priv->cp_ring = NULL;
|
||||
}
|
||||
if ( dev_priv->ring_rptr != NULL ) {
|
||||
drm_core_ioremapfree( dev_priv->ring_rptr, dev );
|
||||
if ( dev->agp_buffer_map != NULL )
|
||||
dev_priv->ring_rptr = NULL;
|
||||
}
|
||||
if ( dev->agp_buffer_map != NULL ) {
|
||||
drm_core_ioremapfree( dev->agp_buffer_map, dev );
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
@ -1424,7 +1430,6 @@ void radeon_do_release( drm_device_t *dev )
|
|||
{
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
int ret;
|
||||
DRM_DEBUG("dev_priv %ptr\n", dev_priv);
|
||||
|
||||
if (dev_priv) {
|
||||
|
||||
|
@ -1761,7 +1766,6 @@ int radeon_preinit( struct drm_device *dev, unsigned long flags )
|
|||
dev_priv = DRM(alloc)( sizeof(drm_radeon_private_t), DRM_MEM_DRIVER );
|
||||
if ( dev_priv == NULL )
|
||||
return DRM_ERR(ENOMEM);
|
||||
DRM_DEBUG("dev_priv %ptr\n", dev_priv);
|
||||
|
||||
memset( dev_priv, 0, sizeof(drm_radeon_private_t) );
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
|
|
Loading…
Reference in New Issue