diff options
Diffstat (limited to 'drivers/gpu/drm/drm_stub.c')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 5ca132afa4f2..46bb923b097c 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -118,12 +118,20 @@ static void drm_master_destroy(struct kref *kref) | |||
118 | struct drm_master *master = container_of(kref, struct drm_master, refcount); | 118 | struct drm_master *master = container_of(kref, struct drm_master, refcount); |
119 | struct drm_magic_entry *pt, *next; | 119 | struct drm_magic_entry *pt, *next; |
120 | struct drm_device *dev = master->minor->dev; | 120 | struct drm_device *dev = master->minor->dev; |
121 | struct drm_map_list *r_list, *list_temp; | ||
121 | 122 | ||
122 | list_del(&master->head); | 123 | list_del(&master->head); |
123 | 124 | ||
124 | if (dev->driver->master_destroy) | 125 | if (dev->driver->master_destroy) |
125 | dev->driver->master_destroy(dev, master); | 126 | dev->driver->master_destroy(dev, master); |
126 | 127 | ||
128 | list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head) { | ||
129 | if (r_list->master == master) { | ||
130 | drm_rmmap_locked(dev, r_list->map); | ||
131 | r_list = NULL; | ||
132 | } | ||
133 | } | ||
134 | |||
127 | if (master->unique) { | 135 | if (master->unique) { |
128 | drm_free(master->unique, master->unique_size, DRM_MEM_DRIVER); | 136 | drm_free(master->unique, master->unique_size, DRM_MEM_DRIVER); |
129 | master->unique = NULL; | 137 | master->unique = NULL; |