[bug report] drm/msm: Add SDM845 DPU support

jesszhan at codeaurora.org jesszhan at codeaurora.org
Fri Oct 1 19:03:36 UTC 2021


Hey Dan,

Thanks for the report, will take care of it.

On 2021-10-01 06:50, Dan Carpenter wrote:
> On Fri, Oct 01, 2021 at 04:49:12PM +0300, Dan Carpenter wrote:
>> Hello Jeykumar Sankaran,
>> 
>> This is a semi-automatic email about new static checker warnings.
>> 
>> The patch 25fdd5933e4c: "drm/msm: Add SDM845 DPU support" from Jun
>> 27, 2018, leads to the following Smatch complaint:
>> 
>>     drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c:422 
>> _dpu_hw_sspp_setup_scaler3()
>>     warn: variable dereferenced before check 'ctx->cap->sblk' (see 
>> line 421)
>> 
>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
>>    420		(void)pe;
>>                 ^^^^^^^^^
>> You should file a bug report with your compiler devs instead of adding
>> these sorts of statements to your code.  This function is used as a
>> function pointer so unused parameters are normal.
>> 
>>    421		if (_sspp_subblk_offset(ctx, DPU_SSPP_SCALER_QSEED3, &idx) || 
>> !sspp
>>                     ^^^^^^^^^^^^^^^^^^^^
>> The _sspp_subblk_offset() dereferenced "ctx" before it is checked and
>> then it also derefereces "ctx->cap->sblk" without checking.
>> 
>>    422			|| !scaler3_cfg || !ctx || !ctx->cap || !ctx->cap->sblk)
>>                                            
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> So these will have already crashed before we reach this point.
>> 
> 
> Same thing later as well.
> 
> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c:591 
> dpu_hw_sspp_setup_creq_lut()
> warn: variable dereferenced before check 'ctx->cap' (see line 588)
> 
> regards,
> dan carpenter

Best,
Jessica Zhang


More information about the dri-devel mailing list