Commit 9237c950 authored by Alex Hung's avatar Alex Hung Committed by Alex Deucher
Browse files

drm/amd/display: Check status from dpcd_get_tunneling_device_data



[WHAT & HOW]
dpcd_get_tunneling_device_data calls core_link_read_dpcd which can
fail. The status from core_link_read_dpcd should be checked and error
messages is printed in case of failures.

This fixes 1 UNUSED_VALUE issue reported by Coverity.

Reviewed-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarRoman Li <roman.li@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 204f5573
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1636,6 +1636,8 @@ static bool retrieve_link_cap(struct dc_link *link)

	/* Read DP tunneling information. */
	status = dpcd_get_tunneling_device_data(link);
	if (status != DC_OK)
		dm_error("%s: Read tunndeling device data failed.\n", __func__);

	dpcd_set_source_specific_data(link);
	/* Sink may need to configure internals based on vendor, so allow some
+7 −0
Original line number Diff line number Diff line
@@ -59,12 +59,18 @@ enum dc_status dpcd_get_tunneling_device_data(struct dc_link *link)
			dpcd_dp_tun_data,
			sizeof(dpcd_dp_tun_data));

	if (status != DC_OK)
		goto err;

	status = core_link_read_dpcd(
			link,
			DP_USB4_ROUTER_TOPOLOGY_ID,
			dpcd_topology_data,
			sizeof(dpcd_topology_data));

	if (status != DC_OK)
		goto err;

	link->dpcd_caps.usb4_dp_tun_info.dp_tun_cap.raw =
			dpcd_dp_tun_data[DP_TUNNELING_CAPABILITIES_SUPPORT - DP_TUNNELING_CAPABILITIES_SUPPORT];
	link->dpcd_caps.usb4_dp_tun_info.dpia_info.raw =
@@ -75,6 +81,7 @@ enum dc_status dpcd_get_tunneling_device_data(struct dc_link *link)
	for (i = 0; i < DPCD_USB4_TOPOLOGY_ID_LEN; i++)
		link->dpcd_caps.usb4_dp_tun_info.usb4_topology_id[i] = dpcd_topology_data[i];

err:
	return status;
}