drm: fix leak of device mappings since multi-master changes.
Device maps now contain a link to the master that created them, so when cleaning up the master, remove any maps that are connected to it. Also delete any remaining maps at driver unload time. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -294,6 +294,7 @@ EXPORT_SYMBOL(drm_init);
|
||||
*/
|
||||
static void drm_cleanup(struct drm_device * dev)
|
||||
{
|
||||
struct drm_map_list *r_list, *list_temp;
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
if (!dev) {
|
||||
@@ -325,6 +326,9 @@ static void drm_cleanup(struct drm_device * dev)
|
||||
drm_ht_remove(&dev->map_hash);
|
||||
drm_ctxbitmap_cleanup(dev);
|
||||
|
||||
list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head)
|
||||
drm_rmmap(dev, r_list->map);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
drm_put_minor(&dev->control);
|
||||
|
||||
|
Reference in New Issue
Block a user