Skip to contentSkip to conversation

drm/amd/display: Add basic infrastructure for enabling FAMS

bug report Dan Carpenter 1 participant 1 message Jul 15, 2022

lore
Share & tools
lore
#0 lore raw

Hello Rodrigo Siqueira,

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

The patch 00fa7f031dd4: "drm/amd/display: Add basic infrastructure for enabling FAMS" from Jun 16, 2022, leads to the following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:311 dc_dmub_srv_p_state_delegate()
warn: variable dereferenced before check 'dc' (see line 309)

drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c
308 int ramp_up_num_steps = 1; // TODO: Ramp is currently disabled. Reenable it.

   309		uint8_t visual_confirm_enabled = dc->debug.visual_confirm == VISUAL_CONFIRM_FAMS;
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^

Dereference

310
311 if (dc == NULL)

                    ^^^^^^^^^^

NULL check is too late

312 return false;
313

regards,
dan carpenter