Skip to contentSkip to conversation

drm/amd/display: Add ABM driver implementation

bug report Dan Carpenter 1 participant 1 message Apr 6, 2020

lore
Share & tools
lore
#0 lore raw

Hello Wyatt Wood,

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

The patch 16012806e697: "drm/amd/display: Add ABM driver implementation" from Feb 20, 2020, leads to the following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/../display/modules/power/power_helpers.c:661 dmcu_load_iram()
warn: variable dereferenced before check 'dmcu' (see line 659)

drivers/gpu/drm/amd/amdgpu/../display/modules/power/power_helpers.c
658 bool result = false;

   659		struct abm *abm = dmcu->ctx->dc->res_pool->abm;
                                  ^^^^^^

The patch adds a dereference

   660	
   661		if (dmcu == NULL && abm == NULL)
                    ^^^^^^^^^^^^

662 return false;
663
664 if (dmcu && !dmcu->funcs->is_dmcu_initialized(dmcu))

                    ^^^^

And it also adds NULL checking on dmcu.

   665                  return true;
   666  
   667          memset(&ram_table, 0, sizeof(ram_table));
   668  

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx