[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202208252240.i49DVUes-lkp@intel.com>
Date: Thu, 25 Aug 2022 17:46:42 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org, Rodrigo Siqueira <Rodrigo.Siqueira@....com>
Cc: lkp@...el.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
Alex Deucher <alexander.deucher@....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)
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@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.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
Powered by blists - more mailing lists