summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-05-04 16:05:14 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-05-05 09:46:38 +0200
commit4a324d33bfe95a279d4c7370d84087d3e773e799 (patch)
treeb6df3147e68912458fc5bdbacdcdedb2f110c445 /drivers/gpu/drm/drm_drv.c
parent32e7b94a3fa8e137aab9f2c65dff86be73245fc8 (diff)
downloadtalos-obmc-linux-4a324d33bfe95a279d4c7370d84087d3e773e799.tar.gz
talos-obmc-linux-4a324d33bfe95a279d4c7370d84087d3e773e799.zip
drm: simplify master cleanup
In drm_master_destroy() we _free_ the master object. There is no reason to hold any locks while dropping its static members, nor do we have to reset it to 0. Furthermore, kfree() already does NULL checks, so call it directly on master->unique and drop the redundant reset-code. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 88b594c0593a..3b3c4f537e95 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -132,15 +132,10 @@ static void drm_master_destroy(struct kref *kref)
r_list = NULL;
}
}
-
- if (master->unique) {
- kfree(master->unique);
- master->unique = NULL;
- master->unique_len = 0;
- }
mutex_unlock(&dev->struct_mutex);
idr_destroy(&master->magic_map);
+ kfree(master->unique);
kfree(master);
}
OpenPOWER on IntegriCloud