]> git.itanic.dy.fi Git - linux-stable/commit
drm/amd/pm: avoid potential UBSAN issue on legacy asics
authorGuchun Chen <guchun.chen@amd.com>
Tue, 9 May 2023 01:36:49 +0000 (09:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:50 +0000 (11:53 +0200)
commit506da05a5e0fa46e048606581dd8bf3fe0161ab2
treefb698adf77641c203c07b5aa82ceeb9202b3440f
parent2a179117a3b29e7136e4045c57090a05bb97f373
drm/amd/pm: avoid potential UBSAN issue on legacy asics

commit 5247f05eadf1081a74b2233f291cee2efed25e3a upstream.

Prevent further dpm casting on legacy asics without od_enabled in
amdgpu_dpm_is_overdrive_supported. This can avoid UBSAN complain
in init sequence.

v2: add a macro to check legacy dpm instead of checking asic family/type
v3: refine macro name for naming consistency

Suggested-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/pm/amdgpu_dpm.c