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

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

parents 54f2b65f dc792e27
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1608,17 +1608,17 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)

	dm->display_indexes_num = dm->dc->caps.max_streams;

	/* 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;