Skip to content

Commit 747d1f0

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-tascam: fix corruption due to spin lock without restoration in SoftIRQ context
ALSA firewire-tascam driver can bring corruption due to spin lock without restoration of IRQ flag in SoftIRQ context. This commit fixes the bug. Cc: Scott Bahling <[email protected]> Cc: <[email protected]> # v4.21 Fixes: d716742 ("ALSA: firewire-tascam: queue events for change of control surface") Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 7fba6ae commit 747d1f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sound/firewire/tascam/amdtp-tascam.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s,
157157
if ((before ^ after) & mask) {
158158
struct snd_firewire_tascam_change *entry =
159159
&tscm->queue[tscm->push_pos];
160+
unsigned long flag;
160161

161-
spin_lock_irq(&tscm->lock);
162+
spin_lock_irqsave(&tscm->lock, flag);
162163
entry->index = index;
163164
entry->before = before;
164165
entry->after = after;
165166
if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)
166167
tscm->push_pos = 0;
167-
spin_unlock_irq(&tscm->lock);
168+
spin_unlock_irqrestore(&tscm->lock, flag);
168169

169170
wake_up(&tscm->hwdep_wait);
170171
}

0 commit comments

Comments
 (0)