From: Sai Gurrappadi Date: Thu, 12 Dec 2013 23:25:53 +0000 (-0800) Subject: cpuquiet: Fix locking in driver_unregister X-Git-Tag: firefly_0821_release~4158^2~24 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e7e8701d152b381f9e38d1bbb489e9a867b4e19b;p=firefly-linux-kernel-4.4.55.git 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 --- 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) {