summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-28 08:47:33 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-28 08:47:33 +0000
commit4327a133c205d5fbeb3a823f62d2f6fa3cc73279 (patch)
tree833804afd139c890712f04f750afbf28e765564e
parent770f024d7ca279390820569f46061830b3b89330 (diff)
Make headset_unlock a no-op if the headset isn't locked
-rw-r--r--audio/headset.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 1a4b1171..bcaa4912 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1584,6 +1584,9 @@ gboolean headset_unlock(struct device *dev, void *data)
{
struct headset *hs = dev->headset;
+ if (!hs->locked)
+ return FALSE;
+
hs->locked = FALSE;
headset_set_state(dev, HEADSET_STATE_DISCONNECTED);