From: Daniel Vetter Date: Tue, 26 Apr 2016 17:29:38 +0000 (+0200) Subject: drm: Push struct_mutex into ->master_destroy X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d787b143d83de94decb801701a005ffd3ec6823;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: Push struct_mutex into ->master_destroy Only two drivers implement this hook. vmwgfx (which doesn't need it really) and legacy radeon (which since v1 has been nuked, yay). v1: Rebase over radeon ums removal. Cc: Thomas Hellstrom Cc: Alex Deucher Reviewed-by: Chris Wilson Reviewed-by: Alex Deucher Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-6-git-send-email-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index f8a7a6e66b7e..55273f8f3acb 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -123,10 +123,10 @@ static void drm_master_destroy(struct kref *kref) struct drm_device *dev = master->minor->dev; struct drm_map_list *r_list, *list_temp; - mutex_lock(&dev->struct_mutex); if (dev->driver->master_destroy) dev->driver->master_destroy(dev, master); + mutex_lock(&dev->struct_mutex); list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head) { if (r_list->master == master) { drm_legacy_rmmap_locked(dev, r_list->map);