drm/radeon: Remove unnecessary NULL test before kfree in 'radeon_connector_free_edid'
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Wed, 26 Jul 2023 16:17:37 +0000 (21:47 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jul 2023 18:59:30 +0000 (14:59 -0400)
Fixes the below:

WARNING: kfree(NULL) is safe and this check is probably not required.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_connectors.c

index 4ceceb972e8d560d4220ee464b88511d6f934485..d2f02c3dfce29780dc1ddda5f718ade98b7ebe90 100644 (file)
@@ -333,10 +333,8 @@ static void radeon_connector_free_edid(struct drm_connector *connector)
 {
        struct radeon_connector *radeon_connector = to_radeon_connector(connector);
 
-       if (radeon_connector->edid) {
-               kfree(radeon_connector->edid);
-               radeon_connector->edid = NULL;
-       }
+       kfree(radeon_connector->edid);
+       radeon_connector->edid = NULL;
 }
 
 static int radeon_ddc_get_modes(struct drm_connector *connector)