[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: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 
        /* 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
 
                        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 =
        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;
 }