From d6295cc9ffe9f36f78131f8049baf24e77d35e15 Mon Sep 17 00:00:00 2001
From: Robert Noland <rnoland@2hip.net>
Date: Sat, 1 Dec 2007 02:40:13 -0500
Subject: drm: Add _DRM_DRIVER map flag.

This flag indicates that the driver is responsible for the map.
---
 linux-core/drm_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'linux-core')

diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 9d03434f..869748f8 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -246,8 +246,10 @@ int drm_lastclose(struct drm_device * dev)
 	}
 
 	list_for_each_entry_safe(r_list, list_t, &dev->maplist, head) {
-		drm_rmmap_locked(dev, r_list->map);
-		r_list = NULL;
+		if (!(r_list->map->flags & _DRM_DRIVER)) {
+			drm_rmmap_locked(dev, r_list->map);
+			r_list = NULL;
+		}
 	}
 
 	if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && dev->queuelist) {
-- 
cgit v1.2.3