From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: sunliming <sunliming@kylinos.cn>, <robdclark@gmail.com>,
<dmitry.baryshkov@linaro.org>
Cc: <linux-kernel@vger.kernel.org>, <kelulanainsley@gmail.com>,
<freedreno@lists.freedesktop.org>,
kernel test robot <lkp@intel.com>,
"Dan Carpenter" <dan.carpenter@oracle.com>
Subject: Re: [PATCH RESEND] drm/msm/dpu: Fix variable dereferenced before check
Date: Thu, 23 Jun 2022 10:32:51 -0700 [thread overview]
Message-ID: <5736c38e-b262-0697-be77-b5126fe4d65b@quicinc.com> (raw)
In-Reply-To: <20220623012707.453972-1-sunliming@kylinos.cn>
On 6/22/2022 6:27 PM, sunliming wrote:
> Fixes the following smatch warning:
>
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c:261
> dpu_encoder_phys_wb_atomic_check() warn: variable dereferenced before check 'conn_state'
>
> Signed-off-by: sunliming <sunliming@kylinos.cn>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for
writeback")
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
> index 59da348ff339..0ec809ab06e7 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
> @@ -252,11 +252,6 @@ static int dpu_encoder_phys_wb_atomic_check(
> DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
> phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay);
>
> - if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
> - return 0;
> -
> - fb = conn_state->writeback_job->fb;
> -
> if (!conn_state || !conn_state->connector) {
> DPU_ERROR("invalid connector state\n");
> return -EINVAL;
> @@ -267,6 +262,11 @@ static int dpu_encoder_phys_wb_atomic_check(
> return -EINVAL;
> }
>
> + if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
> + return 0;
> +
> + fb = conn_state->writeback_job->fb;
> +
> DPU_DEBUG("[fb_id:%u][fb:%u,%u]\n", fb->base.id,
> fb->width, fb->height);
>
next prev parent reply other threads:[~2022-06-23 18:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 1:27 [PATCH RESEND] drm/msm/dpu: Fix variable dereferenced before check sunliming
2022-06-23 17:32 ` Abhinav Kumar [this message]
2022-06-24 1:07 sunliming
2022-06-25 0:13 ` Dmitry Baryshkov
2022-06-28 0:52 sunliming
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=5736c38e-b262-0697-be77-b5126fe4d65b@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=dan.carpenter@oracle.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=freedreno@lists.freedesktop.org \
--cc=kelulanainsley@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=robdclark@gmail.com \
--cc=sunliming@kylinos.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.