[bug report] drm/amd/display: refactor destructive verify link cap sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Wenjing Liu,

The patch 1a206273c322: "drm/amd/display: refactor destructive verify
link cap sequence" from Jan 28, 2022, leads to the following Smatch
static checker warning:

	drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:3248 dp_verify_link_cap()
	error: uninitialized symbol 'status'.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c
    3192 static bool dp_verify_link_cap(
    3193         struct dc_link *link,
    3194         struct dc_link_settings *known_limit_link_setting,
    3195         int *fail_count)
    3196 {
    3197         struct dc_link_settings cur_link_settings = {0};
    3198         struct dc_link_settings initial_link_settings = *known_limit_link_setting;
    3199         bool success = false;
    3200         bool skip_video_pattern;
    3201         enum clock_source_id dp_cs_id = get_clock_source_id(link);
    3202         enum link_training_result status;
    3203         union hpd_irq_data irq_data;
    3204         struct link_resource link_res;
    3205 
    3206         memset(&irq_data, 0, sizeof(irq_data));
    3207         cur_link_settings = initial_link_settings;
    3208 
    3209         /* Grant extended timeout request */
    3210         if ((link->lttpr_mode == LTTPR_MODE_NON_TRANSPARENT) && (link->dpcd_caps.lttpr_caps.max_ext_timeout > 0)) {
    3211                 uint8_t grant = link->dpcd_caps.lttpr_caps.max_ext_timeout & 0x80;
    3212 
    3213                 core_link_write_dpcd(link, DP_PHY_REPEATER_EXTENDED_WAIT_TIMEOUT, &grant, sizeof(grant));
    3214         }
    3215 
    3216         do {
    3217                 if (!get_temp_dp_link_res(link, &link_res, &cur_link_settings))
    3218                         continue;

"status" is not set on this continure path.

    3219 
    3220                 skip_video_pattern = cur_link_settings.link_rate != LINK_RATE_LOW;
    3221                 dp_enable_link_phy(
    3222                                 link,
    3223                                 &link_res,
    3224                                 link->connector_signal,
    3225                                 dp_cs_id,
    3226                                 &cur_link_settings);
    3227 
    3228                 status = dc_link_dp_perform_link_training(
    3229                                 link,
    3230                                 &link_res,
    3231                                 &cur_link_settings,
    3232                                 skip_video_pattern);
    3233 
    3234                 if (status == LINK_TRAINING_SUCCESS) {
    3235                         success = true;
    3236                         udelay(1000);
    3237                         if (read_hpd_rx_irq_data(link, &irq_data) == DC_OK &&
    3238                                         hpd_rx_irq_check_link_loss_status(
    3239                                                         link,
    3240                                                         &irq_data))
    3241                                 (*fail_count)++;
    3242 
    3243                 } else {
    3244                         (*fail_count)++;
    3245                 }
    3246                 dp_disable_link_phy(link, &link_res, link->connector_signal);
    3247         } while (!success && decide_fallback_link_setting(link,
--> 3248                         initial_link_settings, &cur_link_settings, status));
                                                                            ^^^^^^
Uninitialized variable

    3249 
    3250         link->verified_link_cap = success ?
    3251                         cur_link_settings : fail_safe_link_settings;
    3252         return success;
    3253 }

regards,
dan carpenter



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux