⬢ DragonFlyBSD Kernel Audit
DF-4040 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/amd/powerplay/smumgr/polaris10_smumgr.c
+++ b/sys/dev/drm/amd/powerplay/smumgr/polaris10_smumgr.c
@@ -704,6 +704,8 @@
 			(struct phm_ppt_v1_information *)(hwmgr->pptable);
 	struct phm_ppt_v1_voltage_lookup_table *lookup_table =
 			table_info->vddc_lookup_table;
+	if (lookup_table == NULL)
+		return -EINVAL;
 	/* tables is already swapped, so in order to use the value from it,
 	 * we need to swap it back.
 	 * We are populating vddc CAC data to BapmVddc table
@@ -1295,6 +1297,8 @@
 	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 	uint32_t vddci;
 
+	if (mm_table == NULL)
+		return -EINVAL;
 	table->VceLevelCount = (uint8_t)(mm_table->count);
 	table->VceBootLevel = 0;
 
@@ -1401,6 +1405,8 @@
 	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 	uint32_t vddci;
 
+	if (mm_table == NULL)
+		return -EINVAL;
 	table->UvdLevelCount = (uint8_t)(mm_table->count);
 	table->UvdBootLevel = 0;