diff options
author | Bernard Zhao <bernard@vivo.com> | 2021-11-15 17:34:35 -0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-11-22 14:45:03 -0500 |
commit | 24adfaffd5adecceb0a2608d5ec2e47756b8a671 (patch) | |
tree | 99cf3d7d98bcf4c954df9872ff2db6243943625a | |
parent | 13d20aabd6ef501229ac002493c6f237482c47de (diff) | |
download | linux-stable-24adfaffd5adecceb0a2608d5ec2e47756b8a671.tar.gz linux-stable-24adfaffd5adecceb0a2608d5ec2e47756b8a671.tar.bz2 linux-stable-24adfaffd5adecceb0a2608d5ec2e47756b8a671.zip |
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>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c index a249a0e5edd0..4b5e4d8e7735 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_sink.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_sink.c @@ -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); } |