drm/amd/pm: check specific index for aldebaran
authorjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 09:34:36 +0000 (09:34 +0000)
committerjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 09:34:36 +0000 (09:34 +0000)
From Jesse Zhang
d0230b37206888c49df41639551802dce27fa26e in linux-6.6.y/6.6.50
0ce8ef2639c112ae203c985b758389e378630aac in mainline linux

sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c

index 266cea9..b30b9b0 100644 (file)
@@ -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);