linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: sunliming <sunliming@kylinos.cn>
Cc: Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
	airlied@linux.ie, daniel@ffwll.ch,
	kernel test robot <lkp@intel.com>,
	kelulanainsley@gmail.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] drm/amd/display: Fix variable dereferenced before check
Date: Fri, 26 Aug 2022 16:39:21 -0400	[thread overview]
Message-ID: <CADnq5_O2WoDxCJG0rx_x1VhqVHxDT8Aa-X1h+5XwPALiO=8qOA@mail.gmail.com> (raw)
In-Reply-To: <20220826084121.94319-1-sunliming@kylinos.cn>

Applied.  Thanks!

Alex

On Fri, Aug 26, 2022 at 4:41 AM sunliming <sunliming@kylinos.cn> wrote:
>
> Fixes the following smatch warning:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:311 dc_dmub_srv_p_state_delegate()
> warn: variable dereferenced before check 'dc' (see line 309)
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: sunliming <sunliming@kylinos.cn>
> ---
>  drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> index 09b304507bad..ebf99e8f93e0 100644
> --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> @@ -323,11 +323,13 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru
>         struct dmub_cmd_fw_assisted_mclk_switch_config *config_data = &cmd.fw_assisted_mclk_switch.config_data;
>         int i = 0;
>         int ramp_up_num_steps = 1; // TODO: Ramp is currently disabled. Reenable it.
> -       uint8_t visual_confirm_enabled = dc->debug.visual_confirm == VISUAL_CONFIRM_FAMS;
> +       uint8_t visual_confirm_enabled;
>
>         if (dc == NULL)
>                 return false;
>
> +       visual_confirm_enabled = dc->debug.visual_confirm == VISUAL_CONFIRM_FAMS;
> +
>         // Format command.
>         cmd.fw_assisted_mclk_switch.header.type = DMUB_CMD__FW_ASSISTED_MCLK_SWITCH;
>         cmd.fw_assisted_mclk_switch.header.sub_type = DMUB_CMD__FAMS_SETUP_FW_CTRL;
> --
> 2.25.1
>

      reply	other threads:[~2022-08-26 20:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  8:41 [PATCH] drm/amd/display: Fix variable dereferenced before check sunliming
2022-08-26 20:39 ` Alex Deucher [this message]

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='CADnq5_O2WoDxCJG0rx_x1VhqVHxDT8Aa-X1h+5XwPALiO=8qOA@mail.gmail.com' \
    --to=alexdeucher@gmail.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kelulanainsley@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.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 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).