[bug report] drm/amd/display: Introduce DML2

Dan Carpenter dan.carpenter at linaro.org
Wed May 8 12:29:33 UTC 2024


Hello Qingqing Zhuo,

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

Commit 7966f319c66d ("drm/amd/display: Introduce DML2") from Jul 28,
2023, leads to the following Smatch complaint:

    drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_wrapper.c:576 dml2_validate_and_build_resource()
    warn: variable dereferenced before check 'context' (see line 569)

    drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_wrapper.c:665 dml2_validate_only()
    warn: variable dereferenced before check 'context' (see line 662)

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_wrapper.c
   568	{
   569		struct dml2_context *dml2 = context->bw_ctx.dml2;
                                            ^^^^^^^^^
Dereferenced

   570		struct dml2_wrapper_scratch *s = &dml2->v20.scratch;
   571		struct dml2_dcn_clocks out_clks;
   572		unsigned int result = 0;
   573		bool need_recalculation = false;
   574		uint32_t cstate_enter_plus_exit_z8_ns;
   575	
   576		if (!context || context->stream_count == 0)
                    ^^^^^^^^
Checked too late

   577			return true;
   578	

regards,
dan carpenter


More information about the amd-gfx mailing list