mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 12:24:37 -04:00
drm/amd/display: cleanup the code a bit
In function dc_sink_destruct, kfree will check pointer, no need to check again. This change is to cleanup the code a bit. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Bernard Zhao <bernard@vivo.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
13d20aabd6
commit
24adfaffd5
@@ -33,14 +33,6 @@
|
||||
* Private functions
|
||||
******************************************************************************/
|
||||
|
||||
static void dc_sink_destruct(struct dc_sink *sink)
|
||||
{
|
||||
if (sink->dc_container_id) {
|
||||
kfree(sink->dc_container_id);
|
||||
sink->dc_container_id = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static bool dc_sink_construct(struct dc_sink *sink, const struct dc_sink_init_data *init_params)
|
||||
{
|
||||
|
||||
@@ -75,7 +67,7 @@ void dc_sink_retain(struct dc_sink *sink)
|
||||
static void dc_sink_free(struct kref *kref)
|
||||
{
|
||||
struct dc_sink *sink = container_of(kref, struct dc_sink, refcount);
|
||||
dc_sink_destruct(sink);
|
||||
kfree(sink->dc_container_id);
|
||||
kfree(sink);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user