[bug report] drm/amd/display: break down dc_link.c

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

 



Hello Wenjing Liu,

This is a semi-automatic email about new static checker warnings.

The patch 54618888d1ea: "drm/amd/display: break down dc_link.c" from 
Jan 18, 2023, leads to the following Smatch complaint:

    drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c:365 dc_link_construct_phy()
    warn: variable dereferenced before check 'link->link_enc' (see line 362)

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c
   356  
   357          enc_init_data.transmitter =
   358                  translate_encoder_to_transmitter(enc_init_data.encoder);
   359          link->link_enc =
   360                  link->dc->res_pool->funcs->link_enc_create(dc_ctx, &enc_init_data);
   361  
   362          DC_LOG_DC("BIOS object table - DP_IS_USB_C: %d", link->link_enc->features.flags.bits.DP_IS_USB_C);
                                                                 ^^^^^^^^^^^^^^^^
Dereference

   363          DC_LOG_DC("BIOS object table - IS_DP2_CAPABLE: %d", link->link_enc->features.flags.bits.IS_DP2_CAPABLE);
                                                                    ^^^^^^^^^^^^^^^^

   364  
   365          if (!link->link_enc) {
                     ^^^^^^^^^^^^^^
Checked too late

   366                  DC_ERROR("Failed to create link encoder!\n");
   367                  goto link_enc_create_fail;
   368          }
   369  

regards,
dan carpenter



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

  Powered by Linux