From: sashiko-bot@kernel.org
To: "Markov Gleb" <markov.gi@npc-ksb.ru>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/powerplay: add NULL check for vega10_ps
Date: Mon, 29 Jun 2026 13:26:54 +0000 [thread overview]
Message-ID: <20260629132654.AB0421F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260629130951.763-1-markov.gi@npc-ksb.ru>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The patch adds NULL checks for the Vega10 hardware manager but misses identical vulnerabilities in the SMU7 and SMU8 hardware managers.
--
commit 3281774cdb4d49d848f2310e1feaba91d2dc6884
Author: Gleb Markov <markov.gi@npc-ksb.ru>
drm/amd/powerplay: add NULL check for vega10_ps
This patch addresses SVACE static analyzer findings by adding NULL checks for
the return value of cast_phw_vega10_power_state() in the Vega10 hardware
manager to prevent potential NULL pointer dereferences.
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
> index 076e10f265463..c81aa245b8a41 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
> @@ -3892,6 +3892,8 @@ static uint32_t vega10_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low)
> return -EINVAL;
>
> vega10_ps = cast_phw_vega10_power_state(&ps->hardware);
> + if (vega10_ps == NULL)
> + return -EINVAL;
[Severity: High]
This isn't a bug introduced by this patch, but while you are addressing this
SVACE warning for Vega10, does the exact same missing NULL check pattern exist
in the SMU7 and SMU8 hardware managers?
For example, in drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c:smu7_dpm_get_sclk():
smu7_ps = cast_phw_smu7_power_state(&ps->hardware);
if (low)
return smu7_ps->performance_levels[0].engine_clock;
And in drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c:smu8_dpm_get_sclk():
smu8_ps = cast_smu8_power_state(&ps->hardware);
if (low)
return smu8_ps->levels[0].engineClock;
Should identical NULL checks be added to smu7_dpm_get_sclk(),
smu7_dpm_get_mclk(), smu8_dpm_get_sclk(), and smu8_dpm_patch_boot_state()
to ensure a complete fix across the subsystem and avoid kernel panics if
the power state magic number check fails?
>
> if (low)
> return vega10_ps->performance_levels[0].gfx_clock;
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260629130951.763-1-markov.gi@npc-ksb.ru?part=1
prev parent reply other threads:[~2026-06-29 13:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 13:09 [PATCH] drm/amd/powerplay: add NULL check for vega10_ps Markov Gleb
2026-06-29 13:26 ` sashiko-bot [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=20260629132654.AB0421F00AC4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=markov.gi@npc-ksb.ru \
--cc=sashiko-reviews@lists.linux.dev \
/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