]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2014 05:12:07 +0000 (22:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2014 05:12:07 +0000 (22:12 -0700)
added patches:
cpuidle-check-the-result-of-cpuidle_get_driver-against-null.patch

queue-3.10/cpuidle-check-the-result-of-cpuidle_get_driver-against-null.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/cpuidle-check-the-result-of-cpuidle_get_driver-against-null.patch b/queue-3.10/cpuidle-check-the-result-of-cpuidle_get_driver-against-null.patch
new file mode 100644 (file)
index 0000000..571c87c
--- /dev/null
@@ -0,0 +1,36 @@
+From 3b9c10e98021e1f92e6f8c7ce1778b86ba68db10 Mon Sep 17 00:00:00 2001
+From: Daniel Fu <danifu@nvidia.com>
+Date: Fri, 30 Aug 2013 19:48:22 +0800
+Subject: cpuidle: Check the result of cpuidle_get_driver() against NULL
+
+From: Daniel Fu <danifu@nvidia.com>
+
+commit 3b9c10e98021e1f92e6f8c7ce1778b86ba68db10 upstream.
+
+If the current CPU has no cpuidle driver, drv will be NULL in
+cpuidle_driver_ref().  Check if that is the case before trying
+to bump up the driver's refcount to prevent the kernel from
+crashing.
+
+[rjw: Subject and changelog]
+Signed-off-by: Daniel Fu <danifu@nvidia.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Cc: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpuidle/driver.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/cpuidle/driver.c
++++ b/drivers/cpuidle/driver.c
+@@ -251,7 +251,8 @@ struct cpuidle_driver *cpuidle_driver_re
+       spin_lock(&cpuidle_driver_lock);
+       drv = cpuidle_get_driver();
+-      drv->refcnt++;
++      if (drv)
++              drv->refcnt++;
+       spin_unlock(&cpuidle_driver_lock);
+       return drv;
index 728ba971f859f5a89f9dc45e1aaa5dc7e31b6629..d634f8ebaef18692e6b7e8e101f4efe9a75029a5 100644 (file)
@@ -3,3 +3,4 @@ powernow-k6-disable-cache-when-changing-frequency.patch
 powernow-k6-correctly-initialize-default-parameters.patch
 powernow-k6-reorder-frequencies.patch
 kbuild-fix-make-headers_install-when-path-is-too-long.patch
+cpuidle-check-the-result-of-cpuidle_get_driver-against-null.patch