From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, YiPeng Chai <YiPeng.Chai@amd.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org,
Alex Deucher <alexander.deucher@amd.com>,
Tao Zhou <tao.zhou1@amd.com>,
Hawking Zhang <Hawking.Zhang@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c:511 ras_core_get_utc_second_timestamp() error: we previously assumed 'ras_core' could be null (see line 507)
Date: Wed, 4 Feb 2026 12:25:38 +0300 [thread overview]
Message-ID: <202602031229.RI8PLyjl-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6bd9ed02871f22beb0e50690b0c3caf457104f7c
commit: ace232eff50e8c898103c56b3b5303e776616274 drm/amdgpu: Add ras module files into amdgpu
config: s390-randconfig-r072-20260202 (https://download.01.org/0day-ci/archive/20260203/202602031229.RI8PLyjl-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 10.5.0
smatch version: v0.5.0-8994-gd50c5a4c
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202602031229.RI8PLyjl-lkp@intel.com/
smatch warnings:
drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c:511 ras_core_get_utc_second_timestamp() error: we previously assumed 'ras_core' could be null (see line 507)
drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c:530 ras_core_ras_interrupt_detected() error: we previously assumed 'ras_core' could be null (see line 526)
drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_umc.c:210 ras_umc_log_pending_bad_bank() warn: variable dereferenced before check 'ecc_node' (see line 208)
vim +/ras_core +511 drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_core.c
13c91b5b4378b5 YiPeng Chai 2025-03-17 505 uint64_t ras_core_get_utc_second_timestamp(struct ras_core_context *ras_core)
13c91b5b4378b5 YiPeng Chai 2025-03-17 506 {
13c91b5b4378b5 YiPeng Chai 2025-03-17 @507 if (ras_core && ras_core->sys_fn &&
^^^^^^^^
If ras_core is NULL
13c91b5b4378b5 YiPeng Chai 2025-03-17 508 ras_core->sys_fn->get_utc_second_timestamp)
13c91b5b4378b5 YiPeng Chai 2025-03-17 509 return ras_core->sys_fn->get_utc_second_timestamp(ras_core);
13c91b5b4378b5 YiPeng Chai 2025-03-17 510
13c91b5b4378b5 YiPeng Chai 2025-03-17 @511 RAS_DEV_ERR(ras_core->dev, "Failed to get system timestamp!\n");
^^^^^^^^^^^^^
Then this will crash.
13c91b5b4378b5 YiPeng Chai 2025-03-17 512 return 0;
13c91b5b4378b5 YiPeng Chai 2025-03-17 513 }
13c91b5b4378b5 YiPeng Chai 2025-03-17 514
13c91b5b4378b5 YiPeng Chai 2025-03-17 515 int ras_core_translate_soc_pa_and_bank(struct ras_core_context *ras_core,
13c91b5b4378b5 YiPeng Chai 2025-03-17 516 uint64_t *soc_pa, struct umc_bank_addr *bank_addr, bool bank_to_pa)
13c91b5b4378b5 YiPeng Chai 2025-03-17 517 {
13c91b5b4378b5 YiPeng Chai 2025-03-17 518 if (!ras_core || !soc_pa || !bank_addr)
13c91b5b4378b5 YiPeng Chai 2025-03-17 519 return -EINVAL;
13c91b5b4378b5 YiPeng Chai 2025-03-17 520
13c91b5b4378b5 YiPeng Chai 2025-03-17 521 return ras_umc_translate_soc_pa_and_bank(ras_core, soc_pa, bank_addr, bank_to_pa);
13c91b5b4378b5 YiPeng Chai 2025-03-17 522 }
13c91b5b4378b5 YiPeng Chai 2025-03-17 523
13c91b5b4378b5 YiPeng Chai 2025-03-17 524 bool ras_core_ras_interrupt_detected(struct ras_core_context *ras_core)
13c91b5b4378b5 YiPeng Chai 2025-03-17 525 {
13c91b5b4378b5 YiPeng Chai 2025-03-17 @526 if (ras_core && ras_core->sys_fn &&
13c91b5b4378b5 YiPeng Chai 2025-03-17 527 ras_core->sys_fn->detect_ras_interrupt)
13c91b5b4378b5 YiPeng Chai 2025-03-17 528 return ras_core->sys_fn->detect_ras_interrupt(ras_core);
13c91b5b4378b5 YiPeng Chai 2025-03-17 529
13c91b5b4378b5 YiPeng Chai 2025-03-17 @530 RAS_DEV_ERR(ras_core->dev, "Failed to detect ras interrupt!\n");
^^^^^^^^^^^^^
Same.
13c91b5b4378b5 YiPeng Chai 2025-03-17 531 return false;
13c91b5b4378b5 YiPeng Chai 2025-03-17 532 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-02-04 9:25 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=202602031229.RI8PLyjl-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=Hawking.Zhang@amd.com \
--cc=YiPeng.Chai@amd.com \
--cc=alexander.deucher@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=tao.zhou1@amd.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
all inboxes | Powered by JetHome®