[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <alpine.LFD.2.00.1005270107360.4039@localhost.localdomain>
Date: Thu, 27 May 2010 01:11:03 -0400 (EDT)
From: Len Brown <lenb@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: x86@...nel.org, linux-pm@...ts.linux-foundation.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH-v2 2/8] cpuidle: add cpuidle_unregister_driver() error check
From: Len Brown <len.brown@...el.com>
BUG_ON() cpuidle_unregister_driver() being called with
a driver not matching the onee that successfully registered.
Signed-off-by: Len Brown <len.brown@...el.com>
---
drivers/cpuidle/driver.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index 2257004..5b6fd0f 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -45,8 +45,7 @@ EXPORT_SYMBOL_GPL(cpuidle_register_driver);
*/
void cpuidle_unregister_driver(struct cpuidle_driver *drv)
{
- if (!drv)
- return;
+ BUG_ON(drv != cpuidle_curr_driver)
spin_lock(&cpuidle_driver_lock);
cpuidle_curr_driver = NULL;
--
1.6.0.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists