Skip to content

Commit a0978e8

Browse files
Stefan Richtertiwai
authored andcommitted
ALSA: firewire-speakers: fix locking
There is a lock inversion between fwspk->mutex and pcm->open_mutex reported by lockdep when fwspk_hw_free is called. Fixed by copying the fix from the same former issue in the isight sound driver (commit f3f7c18 "ALSA: isight: fix locking"). Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent bb690c9 commit a0978e8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎sound/firewire/speakers.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,9 +778,10 @@ static int __devexit fwspk_remove(struct device *dev)
778778
{
779779
struct fwspk *fwspk = dev_get_drvdata(dev);
780780

781-
mutex_lock(&fwspk->mutex);
782781
amdtp_out_stream_pcm_abort(&fwspk->stream);
783782
snd_card_disconnect(fwspk->card);
783+
784+
mutex_lock(&fwspk->mutex);
784785
fwspk_stop_stream(fwspk);
785786
mutex_unlock(&fwspk->mutex);
786787

@@ -796,8 +797,8 @@ static void fwspk_bus_reset(struct fw_unit *unit)
796797
fcp_bus_reset(fwspk->unit);
797798

798799
if (cmp_connection_update(&fwspk->connection) < 0) {
799-
mutex_lock(&fwspk->mutex);
800800
amdtp_out_stream_pcm_abort(&fwspk->stream);
801+
mutex_lock(&fwspk->mutex);
801802
fwspk_stop_stream(fwspk);
802803
mutex_unlock(&fwspk->mutex);
803804
return;

0 commit comments

Comments
 (0)