提交 4a324d33 编写于 作者: D David Herrmann 提交者: Daniel Vetter

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: NDavid Herrmann <dh.herrmann@gmail.com>
Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 32e7b94a
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册