Skip to contentSkip to conversation

drm/amd/pm: check specific index for smu13

PATCH Superseded Jesse Zhang 2 participants 2 messages May 10, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 9/22 drm/amd/pm: check specific index for smu13

Check for specific indexes that may be invalid values.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +2 -0
index 051092f1b1b4..7c343dd12a7f 100644
@@ -2336,6 +2336,8 @@ static int smu_v13_0_6_mode2_reset(struct smu_context *smu)
 
 	index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
 					       SMU_MSG_GfxDeviceDriverReset);
+	if (index < 0)
+		return index;
 
 	mutex_lock(&smu->message_lock);
 
Signature · 1 line
2.25.1
Reviewed-by on v2 9/22
#1 lore raw

[AMD Official Use Only - General]

This patch is,

Quoted 36 lines

-----Original Message-----
From: Jesse Zhang <[email protected]>
Sent: Friday, May 10, 2024 3:07 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Huang, Tim <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 09/22 V2] drm/amd/pm: check specific index for smu13

Check for specific indexes that may be invalid values.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +2 -0
index 051092f1b1b4..7c343dd12a7f 100644
@@ -2336,6 +2336,8 @@ static int smu_v13_0_6_mode2_reset(struct
 smu_context *smu)
 
      index = smu_cmn_to_asic_specific_index(smu,
 CMN2ASIC_MAPPING_MSG,
                                             SMU_MSG_GfxDeviceDriverReset);
+     if (index < 0)
+             return index;
 
      mutex_lock(&smu->message_lock);

--
2.25.1