Unverified Commit e4bfde20 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12039 drm/amd/display: Stop amdgpu_dm initialize when link nums greater than max_links

parents 634e183e 81bea8e9
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -4450,17 +4450,17 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
		}
	}

	/* loops over all connectors on the board */
	for (i = 0; i < link_cnt; i++) {
		struct dc_link *link = NULL;

		if (i > AMDGPU_DM_MAX_DISPLAY_INDEX) {
	if (link_cnt > MAX_PIPES * 2) {
		DRM_ERROR(
			"KMS: Cannot support more than %d display indexes\n",
					AMDGPU_DM_MAX_DISPLAY_INDEX);
			continue;
				MAX_PIPES * 2);
		goto fail;
	}

	/* loops over all connectors on the board */
	for (i = 0; i < link_cnt; i++) {
		struct dc_link *link = NULL;

		aconnector = kzalloc(sizeof(*aconnector), GFP_KERNEL);
		if (!aconnector)
			goto fail;