drm/amdgpu/dm/mst: Remove unnecessary NULL check
authorLyude Paul <lyude@redhat.com>
Thu, 26 Sep 2019 22:51:04 +0000 (18:51 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Oct 2019 14:11:05 +0000 (09:11 -0500)
kfree() checks this automatically.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

index 16218a202b591c022b79191e8f79a91e952ef163..357a7ff20b2b428ac5450ec3bcaaac610e77f338 100644 (file)
@@ -144,10 +144,8 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector)
        struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector);
        struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder;
 
-       if (amdgpu_dm_connector->edid) {
-               kfree(amdgpu_dm_connector->edid);
-               amdgpu_dm_connector->edid = NULL;
-       }
+       kfree(amdgpu_dm_connector->edid);
+       amdgpu_dm_connector->edid = NULL;
 
        drm_encoder_cleanup(&amdgpu_encoder->base);
        kfree(amdgpu_encoder);