Skip to content

Commit

Permalink
ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read
Browse files Browse the repository at this point in the history
For the MIDI part, we need to acquire (and release) the hmidi->lock,
access to the global hdspm structure is serialized through
hmidi->hdspm->lock instead.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Adrian Knoth authored and Takashi Iwai committed Jun 12, 2011
1 parent 05e2054 commit c0da001
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/pci/rme9652/hdspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1639,12 +1639,14 @@ static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi)
}
}
hmidi->pending = 0;
spin_unlock_irqrestore(&hmidi->lock, flags);

spin_lock_irqsave(&hmidi->hdspm->lock, flags);
hmidi->hdspm->control_register |= hmidi->ie;
hdspm_write(hmidi->hdspm, HDSPM_controlRegister,
hmidi->hdspm->control_register);
spin_unlock_irqrestore(&hmidi->hdspm->lock, flags);

spin_unlock_irqrestore (&hmidi->lock, flags);
return snd_hdspm_midi_output_write (hmidi);
}

Expand Down

0 comments on commit c0da001

Please sign in to comment.