linux/drivers/cpuidle
Srivatsa S. Bhat 1b0a0e9a15 cpuidle: add checks to avoid NULL pointer dereference
The existing check for dev == NULL in __cpuidle_register_device() is
rendered useless because dev is dereferenced before the check itself.
Moreover, correctly speaking, it is the job of the callers of this
function, i.e., cpuidle_register_device() & cpuidle_enable_device() (which
also happen to be exported functions) to ensure that
__cpuidle_register_device() is called with a non-NULL dev.

So add the necessary dev == NULL checks in the two callers and remove the
(useless) check from __cpuidle_register_device().

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-01 16:07:23 -04:00
..
governors cpuidle: power_usage should be declared signed integer 2012-03-30 03:23:30 -04:00
cpuidle.c cpuidle: add checks to avoid NULL pointer dereference 2012-06-01 16:07:23 -04:00
cpuidle.h cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
driver.c cpuidle: use the driver's state_count as default 2012-03-30 01:55:04 -04:00
governor.c cpuidle: create bootparam "cpuidle.off=1" 2011-08-03 19:06:36 -04:00
Kconfig cpuidle: Default y on powerpc pSeries 2012-02-22 16:48:51 +11:00
Makefile cpuidle: consolidate 2.6.22 cpuidle branch into one patch 2007-10-10 00:12:41 -04:00
sysfs.c cpuidle: add a sysfs entry to disable specific C state for debug purpose. 2012-03-30 01:52:58 -04:00