drm/radeon/kms: improve bpc handling (v2)

Dan Carpenter dan.carpenter at oracle.com
Sun May 13 08:31:35 PDT 2012


Hello Alex Deucher,

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

The patch eccea7920cfb: "drm/radeon/kms: improve bpc handling (v2)" 
from Mar 26, 2012, leads to the following Smatch complaint:

drivers/gpu/drm/radeon/atombios_crtc.c:599 atombios_adjust_pll()
	 warn: variable dereferenced before check 'connector' (see line 594)

drivers/gpu/drm/radeon/atombios_crtc.c
   593				connector = radeon_get_connector_for_encoder(encoder);
   594				bpc = radeon_get_monitor_bpc(connector);
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"connector" is dereferenced inside the call to radeon_get_monitor_bpc().
New in this patch.

   595				encoder_mode = atombios_get_encoder_mode(encoder);
   596				is_duallink = radeon_dig_monitor_is_duallink(encoder, mode->clock);
   597				if ((radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) ||
   598				    (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE)) {
   599					if (connector) {
                                            ^^^^^^^^^
Old check.

   600						struct radeon_connector *radeon_connector = to_radeon_connector(connector);
   601						struct radeon_connector_atom_dig *dig_connector =

regards,
dan carpenter



More information about the dri-devel mailing list