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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux