|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH][1/2] In cpufreq, check for a driver before use
The current cpufreq driver code assumes that a driver
was registered before cpufreq_add_cpu() is called.
If the driver was not registered or failed registration,
cpufreq_add_cpu() crashes.
Test to make sure that cpufreq_driver isn't NULL.
Signed-off-by: Mark Langsdorf <mark.langsdorf@xxxxxxx>
diff -r d7d7f978d704 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c Tue Oct 20 14:36:01 2009 +0100
+++ b/xen/drivers/cpufreq/cpufreq.c Wed Oct 21 15:08:27 2009 -0500
@@ -142,6 +142,9 @@
!(perf->init & XEN_PX_INIT) ||
!cpu_online(cpu))
return -EINVAL;
+
+ if (!cpufreq_driver)
+ return 0;
if (cpufreq_cpu_policy[cpu])
return 0;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |