From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
Alex Deucher <alexander.deucher@amd.com>
Subject: 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)
Date: Thu, 25 Aug 2022 17:46:42 +0300 [thread overview]
Message-ID: <202208252240.i49DVUes-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c40e8341e3b3bb27e3a65b06b5b454626234c4f0
commit: 00fa7f031dd4b885175da390e24cb02f6a45977e drm/amd/display: Add basic infrastructure for enabling FAMS
config: microblaze-randconfig-m041-20220824 (https://download.01.org/0day-ci/archive/20220825/202208252240.i49DVUes-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
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)
vim +/dc +311 drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 303 bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, struct dc_state *context)
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 304 {
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 305 union dmub_rb_cmd cmd = { 0 };
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 306 struct dmub_cmd_fw_assisted_mclk_switch_config *config_data = &cmd.fw_assisted_mclk_switch.config_data;
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 307 int i = 0;
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 308 int ramp_up_num_steps = 1; // TODO: Ramp is currently disabled. Reenable it.
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 @309 uint8_t visual_confirm_enabled = dc->debug.visual_confirm == VISUAL_CONFIRM_FAMS;
^^^^^^^^^^^^^^^^^^^^^^^^
Dereference
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 310
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 @311 if (dc == NULL)
^^^^^^^^^^
Too late
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 312 return false;
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 313
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 314 // Format command.
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 315 cmd.fw_assisted_mclk_switch.header.type = DMUB_CMD__FW_ASSISTED_MCLK_SWITCH;
00fa7f031dd4b88 Rodrigo Siqueira 2022-06-16 316 cmd.fw_assisted_mclk_switch.header.sub_type = DMUB_CMD__FAMS_SETUP_FW_CTRL;
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-08-25 14:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202208252240.i49DVUes-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=alexander.deucher@amd.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
/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