mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-02 02:52:46 +02:00
Fixes issue with Xen dom0 http://lists.xen.org/archives/html/xen-devel/2012-07/msg01838.html
35 lines
1.3 KiB
Diff
35 lines
1.3 KiB
Diff
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
|
Date: Thu, 16 Aug 2012 20:06:55 +0000 (+0200)
|
|
Subject: intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.
|
|
X-Git-Tag: v3.6-rc3~33^2
|
|
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git;a=commitdiff_plain;h=3735d524da64b70b41c764359da36f88aded3610
|
|
|
|
intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.
|
|
|
|
If the machine is booted without any cpu_idle driver set
|
|
(b/c disable_cpuidle() has been called) we should follow
|
|
other users of cpu_idle API and check the return value
|
|
for NULL before using it.
|
|
|
|
Reported-and-tested-by: Mark van Dijk <mark@internecto.net>
|
|
Suggested-by: Jan Beulich <JBeulich@suse.com>
|
|
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
|
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
|
|
---
|
|
|
|
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
|
|
index f559088..e872617 100644
|
|
--- a/drivers/idle/intel_idle.c
|
|
+++ b/drivers/idle/intel_idle.c
|
|
@@ -606,8 +606,9 @@ static int __init intel_idle_init(void)
|
|
intel_idle_cpuidle_driver_init();
|
|
retval = cpuidle_register_driver(&intel_idle_driver);
|
|
if (retval) {
|
|
+ struct cpuidle_driver *drv = cpuidle_get_driver();
|
|
printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
|
|
- cpuidle_get_driver()->name);
|
|
+ drv ? drv->name : "none");
|
|
return retval;
|
|
}
|
|
|