From: jsg Date: Mon, 9 Sep 2024 09:34:36 +0000 (+0000) Subject: drm/amd/pm: check specific index for aldebaran X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ba6f5215002d8c54d9a1a25391926773326a79dc;p=openbsd drm/amd/pm: check specific index for aldebaran From Jesse Zhang d0230b37206888c49df41639551802dce27fa26e in linux-6.6.y/6.6.50 0ce8ef2639c112ae203c985b758389e378630aac in mainline linux --- diff --git a/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index 266cea9b242..b30b9b0da12 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ b/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -1933,7 +1933,8 @@ static int aldebaran_mode2_reset(struct smu_context *smu) index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG, SMU_MSG_GfxDeviceDriverReset); - + if (index < 0 ) + return -EINVAL; mutex_lock(&smu->message_lock); if (smu_version >= 0x00441400) { ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, SMU_RESET_MODE_2);