⬢ DragonFlyBSD Kernel Audit
DF-5067 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/amd/powerplay/hwmgr/pp_psm.c
+++ b/sys/dev/drm/amd/powerplay/hwmgr/pp_psm.c
@@ -243,11 +243,14 @@ static void power_state_management(struct pp_hwmgr *hwmgr,
 	if (new_ps != NULL)
 		requested = new_ps;
 	else
 		requested = hwmgr->request_ps;
 
 	pcurrent = hwmgr->current_ps;
+	if (pcurrent == NULL)
+		return;
+
 	phm_apply_state_adjust_rules(hwmgr, requested, pcurrent);
 	if (pcurrent == NULL || (0 != phm_check_states_equal(hwmgr,
 			&pcurrent->hardware, &requested->hardware, &equal)))
 		equal = false;