[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    Input - arizona-haptics: Fix double lock of dapm_mutex
From:       "Linux Kernel Mailing List" <linux-kernel () vger ! kernel ! org>
Date:       2014-02-28 22:55:16
Message-ID: 20140228225516.339DE660CC7 () gitolite ! kernel ! org
[Download RAW message or body]

Gitweb:     http://git.kernel.org/linus/;a=commit;h=c4204960e9d0ba99459dbf1db918f99a45e7a62a
Commit:     c4204960e9d0ba99459dbf1db918f99a45e7a62a
Parent:     30686c350628a68852f8abd67557aecb137789d5
Author:     Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
AuthorDate: Tue Feb 18 15:22:12 2014 +0000
Committer:  Mark Brown <broonie@linaro.org>
CommitDate: Thu Feb 20 18:37:13 2014 +0900

    Input - arizona-haptics: Fix double lock of dapm_mutex
    
    snd_soc_dapm_sync takes the dapm_mutex internally, but we currently take
    it externally as well. This patch fixes this.
    
    Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
    Signed-off-by: Mark Brown <broonie@linaro.org>
    Cc: stable@vger.kernel.org
---
 drivers/input/misc/arizona-haptics.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/input/misc/arizona-haptics.c b/drivers/input/misc/arizona-haptics.c
index 7a04f54..e7e12a5 100644
--- a/drivers/input/misc/arizona-haptics.c
+++ b/drivers/input/misc/arizona-haptics.c
@@ -77,16 +77,14 @@ static void arizona_haptics_work(struct work_struct *work)
 			return;
 		}
 
+		mutex_unlock(dapm_mutex);
+
 		ret = snd_soc_dapm_sync(arizona->dapm);
 		if (ret != 0) {
 			dev_err(arizona->dev, "Failed to sync DAPM: %d\n",
 				ret);
-			mutex_unlock(dapm_mutex);
 			return;
 		}
-
-		mutex_unlock(dapm_mutex);
-
 	} else {
 		/* This disable sequence will be a noop if already enabled */
 		mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
@@ -99,16 +97,15 @@ static void arizona_haptics_work(struct work_struct *work)
 			return;
 		}
 
+		mutex_unlock(dapm_mutex);
+
 		ret = snd_soc_dapm_sync(arizona->dapm);
 		if (ret != 0) {
 			dev_err(arizona->dev, "Failed to sync DAPM: %d\n",
 				ret);
-			mutex_unlock(dapm_mutex);
 			return;
 		}
 
-		mutex_unlock(dapm_mutex);
-
 		ret = regmap_update_bits(arizona->regmap,
 					 ARIZONA_HAPTICS_CONTROL_1,
 					 ARIZONA_HAP_CTRL_MASK,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic