linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jesszhan@codeaurora.org
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: jsanka@codeaurora.org, linux-arm-msm@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [bug report] drm/msm: Add SDM845 DPU support
Date: Fri, 01 Oct 2021 12:03:36 -0700	[thread overview]
Message-ID: <aee1c5723cf0be018c8f9b8bcbd834f0@codeaurora.org> (raw)
In-Reply-To: <20211001135033.GZ2083@kadam>

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

  reply	other threads:[~2021-10-01 19:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 13:49 [bug report] drm/msm: Add SDM845 DPU support Dan Carpenter
2021-10-01 13:50 ` Dan Carpenter
2021-10-01 19:03   ` jesszhan [this message]
2021-10-19 23:37   ` Jessica Zhang
  -- strict thread matches above, loose matches on Subject: below --
2021-10-04 13:46 Dan Carpenter
2021-10-01 14:21 Dan Carpenter
2021-10-01 12:28 Dan Carpenter
2021-10-01 19:04 ` jesszhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aee1c5723cf0be018c8f9b8bcbd834f0@codeaurora.org \
    --to=jesszhan@codeaurora.org \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsanka@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).