[bug report] drm/amd/display: Add interface to enable DPIA trace

Dan Carpenter dan.carpenter at linaro.org
Tue Oct 31 08:57:32 UTC 2023


Hello Stylon Wang,

The patch 71ba6b577a35: "drm/amd/display: Add interface to enable
DPIA trace" from Jun 30, 2023 (linux-next), leads to the following
Smatch static checker warning:

	drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:1041 dc_dmub_srv_enable_dpia_trace()
	error: we previously assumed 'dc_dmub_srv' could be null (see line 1040)

drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c
    1033 void dc_dmub_srv_enable_dpia_trace(const struct dc *dc)
    1034 {
    1035         struct dc_dmub_srv *dc_dmub_srv = dc->ctx->dmub_srv;
    1036         struct dmub_srv *dmub;
    1037         enum dmub_status status;
    1038         static const uint32_t timeout_us = 30;
    1039 
    1040         if (!dc_dmub_srv || !dc_dmub_srv->dmub) {
--> 1041                 DC_LOG_ERROR("%s: invalid parameters.", __func__);
                         ^^^^^^^^^^^^^
This macro dereferences dc_dmub_srv.

    1042                 return;
    1043         }
    1044 
    1045         dmub = dc_dmub_srv->dmub;

regards,
dan carpenter


More information about the amd-gfx mailing list