From e7e8701d152b381f9e38d1bbb489e9a867b4e19b Mon Sep 17 00:00:00 2001 From: Sai Gurrappadi Date: Thu, 12 Dec 2013 15:25:53 -0800 Subject: [PATCH] cpuquiet: Fix locking in driver_unregister cpuquiet_switch_governors needs to be protected with the cpuquiet_lock. Change-Id: I948d1190a270b9e8b732eaad80a303560fe9f282 Signed-off-by: Sai Gurrappadi Reviewed-on: http://git-master/r/345013 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Peter Boonstoppel Reviewed-by: Diwakar Tundlam --- drivers/cpuquiet/driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/cpuquiet/driver.c b/drivers/cpuquiet/driver.c index fb9912b86e5e..097d2e36b79d 100644 --- a/drivers/cpuquiet/driver.c +++ b/drivers/cpuquiet/driver.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2012-2013 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -197,10 +197,10 @@ void cpuquiet_unregister_driver(struct cpuquiet_driver *drv) return; } - /* stop current governor first */ - cpuquiet_switch_governor(NULL); - mutex_lock(&cpuquiet_lock); + + /* Stop current governor first */ + cpuquiet_switch_governor(NULL); cpuquiet_curr_driver = NULL; for_each_possible_cpu(cpu) { -- 2.34.1