Skip to content

Commit 24adfaf

Browse files
Bernard Zhaoalexdeucher
authored andcommitted
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>
1 parent 13d20aa commit 24adfaf

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎drivers/gpu/drm/amd/display/dc/core/dc_sink.c‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@
3333
* Private functions
3434
******************************************************************************/
3535

36-
static void dc_sink_destruct(struct dc_sink *sink)
37-
{
38-
if (sink->dc_container_id) {
39-
kfree(sink->dc_container_id);
40-
sink->dc_container_id = NULL;
41-
}
42-
}
43-
4436
static bool dc_sink_construct(struct dc_sink *sink, const struct dc_sink_init_data *init_params)
4537
{
4638

@@ -75,7 +67,7 @@ void dc_sink_retain(struct dc_sink *sink)
7567
static void dc_sink_free(struct kref *kref)
7668
{
7769
struct dc_sink *sink = container_of(kref, struct dc_sink, refcount);
78-
dc_sink_destruct(sink);
70+
kfree(sink->dc_container_id);
7971
kfree(sink);
8072
}
8173

0 commit comments

Comments
 (0)