linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soundwire: stream: fix bad unlock balance
@ 2019-05-22 16:25 Srinivas Kandagatla
  2019-05-22 16:41 ` Pierre-Louis Bossart
  2019-05-22 16:41 ` Srinivas Kandagatla
  0 siblings, 2 replies; 7+ messages in thread
From: Srinivas Kandagatla @ 2019-05-22 16:25 UTC (permalink / raw)
  To: vkoul
  Cc: sanyog.r.kale, pierre-louis.bossart, alsa-devel, linux-kernel,
	Srinivas Kandagatla

This patch fixes below warning due to unlocking without locking.

 =====================================
 WARNING: bad unlock balance detected!
 5.1.0-16506-gc1c383a6f0a2-dirty #1523 Tainted: G        W
 -------------------------------------
 aplay/2954 is trying to release lock (&bus->msg_lock) at:
 do_bank_switch+0x21c/0x480
 but there are no more locks to release!

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/soundwire/stream.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 544925ff0b40..d16268f30e4f 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -814,7 +814,8 @@ static int do_bank_switch(struct sdw_stream_runtime *stream)
 			goto error;
 		}
 
-		mutex_unlock(&bus->msg_lock);
+		if (mutex_is_locked(&bus->msg_lock))
+			utex_unlock(&bus->msg_lock);
 	}
 
 	return ret;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-23  9:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 16:25 [PATCH] soundwire: stream: fix bad unlock balance Srinivas Kandagatla
2019-05-22 16:41 ` Pierre-Louis Bossart
2019-05-23  8:43   ` Srinivas Kandagatla
2019-05-23  9:20     ` Sanyog Kale
2019-05-23  9:30       ` Srinivas Kandagatla
2019-05-23  9:41         ` Sanyog Kale
2019-05-22 16:41 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).