Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <srinivas.kandagatla@linaro.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Sanyog Kale <sanyog.r.kale@intel.com>
[vkoul: edited the change log as suggested by Pierre]
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Srinivas Kandagatla and committed by
Vinod Koul
9315d904 03ecad90

+2 -1
+2 -1
drivers/soundwire/stream.c
··· 814 814 goto error; 815 815 } 816 816 817 - mutex_unlock(&bus->msg_lock); 817 + if (bus->multi_link) 818 + mutex_unlock(&bus->msg_lock); 818 819 } 819 820 820 821 return ret;