drm/amd/display: Remove redundant null check
authorAlex Hung <alex.hung@amd.com>
Mon, 14 Apr 2025 16:00:59 +0000 (10:00 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 May 2025 16:54:32 +0000 (12:54 -0400)
[WHY & HOW]
The null check for connector was dereferenced previously in the same
function and the caller.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 51255016e5fbba6c1cc6ee86d552c62f0c3b92c7..6525a190bb0ca291bb64f5b9557bd95d218a59d4 100644 (file)
@@ -6989,11 +6989,6 @@ create_stream_for_sink(struct drm_connector *connector,
        drm_mode_init(&mode, drm_mode);
        memset(&saved_mode, 0, sizeof(saved_mode));
 
-       if (connector == NULL) {
-               drm_err(dev, "connector is NULL!\n");
-               return stream;
-       }
-
        if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) {
                aconnector = NULL;
                aconnector = to_amdgpu_dm_connector(connector);