Skip to content

Commit 9315d90

Browse files
Srinivas-Kandagatlavinodkoul
authored andcommitted
soundwire: stream: fix bad unlock balance
the msg lock is taken for multi-link cases only but released unconditionally, leading to an unlock balance warning for single-link usages This patch fixes this. ===================================== 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 <[email protected]> Acked-by: Pierre-Louis Bossart <[email protected]> Acked-by: Sanyog Kale <[email protected]> [vkoul: edited the change log as suggested by Pierre] Signed-off-by: Vinod Koul <[email protected]>
1 parent 03ecad9 commit 9315d90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/soundwire/stream.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,8 @@ static int do_bank_switch(struct sdw_stream_runtime *stream)
814814
goto error;
815815
}
816816

817-
mutex_unlock(&bus->msg_lock);
817+
if (bus->multi_link)
818+
mutex_unlock(&bus->msg_lock);
818819
}
819820

820821
return ret;

0 commit comments

Comments
 (0)