[bug report] drm/amd/display: add DMUB registers to crash dump diagnostic data.

Dan Carpenter dan.carpenter at linaro.org
Thu Sep 28 07:05:24 UTC 2023


Hello Ashley Thomas,

The patch 2631ac1ac328: "drm/amd/display: add DMUB registers to crash
dump diagnostic data." from May 17, 2021 (linux-next), leads to the
following Smatch static checker warning:

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

drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c
    795 void dc_dmub_srv_log_diagnostic_data(struct dc_dmub_srv *dc_dmub_srv)
    796 {
    797         struct dmub_diagnostic_data diag_data = {0};
    798 
    799         if (!dc_dmub_srv || !dc_dmub_srv->dmub) {
                     ^^^^^^^^^^^
Check for NULL.

--> 800                 DC_LOG_ERROR("%s: invalid parameters.", __func__);

The logging will dereference dc_dmub_srv.

    801                 return;
    802         }
    803 
    804         if (!dc_dmub_srv_get_diagnostic_data(dc_dmub_srv, &diag_data)) {

regards,
dan carpenter


More information about the amd-gfx mailing list