summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-02-15 12:43:39 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-02-15 12:43:39 +0000
commitf81d1c94005a9ffb41a857f84b267e11346ddedb (patch)
tree487e199eac32250d072117fc4dfad9d4decfeb4a /sys/dev
parentd3cdf110d55da510d7d3b855658ffca6618f6435 (diff)
radeon/pm: Guard access to rdev->pm.power_state array
From Michel Daenzer 0a44540222a9693995ac4d188f9dbaeb394d00bf in ubuntu 3.8 370169516e736edad3b3c5aa49858058f8b55195 in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/radeon/radeon_pm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_pm.c b/sys/dev/pci/drm/radeon/radeon_pm.c
index 0c45d4ab90f..f9827dcc6c3 100644
--- a/sys/dev/pci/drm/radeon/radeon_pm.c
+++ b/sys/dev/pci/drm/radeon/radeon_pm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_pm.c,v 1.6 2014/02/09 11:03:31 jsg Exp $ */
+/* $OpenBSD: radeon_pm.c,v 1.7 2014/02/15 12:43:38 jsg Exp $ */
/*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -599,8 +599,10 @@ void radeon_pm_resume(struct radeon_device *rdev)
rdev->pm.current_clock_mode_index = 0;
rdev->pm.current_sclk = rdev->pm.default_sclk;
rdev->pm.current_mclk = rdev->pm.default_mclk;
- rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
- rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci;
+ if (rdev->pm.power_state) {
+ rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
+ rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci;
+ }
if (rdev->pm.pm_method == PM_METHOD_DYNPM
&& rdev->pm.dynpm_state == DYNPM_STATE_SUSPENDED) {
rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE;