Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5929546a96d55962bdcabae0c4e25dfcd9f1fda9
Commit:     5929546a96d55962bdcabae0c4e25dfcd9f1fda9
Parent:     5b005a0126bc2a2be3ae2c333d56e91bd5e2d8a6
Author:     Giuliano Pochini <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 6 11:42:00 2006 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Jan 9 09:06:13 2007 +0100

    [ALSA] Fix potential NULL pointer dereference in echoaudio midi
    
    Fix races between the timer handler and the close function.
    
    Signed-off-by: Giuliano Pochini <[EMAIL PROTECTED]>
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/echoaudio/midi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c
index e31f0f1..91f5bff 100644
--- a/sound/pci/echoaudio/midi.c
+++ b/sound/pci/echoaudio/midi.c
@@ -213,7 +213,7 @@ static void snd_echo_midi_output_write(unsigned long data)
        sent = bytes = 0;
        spin_lock_irqsave(&chip->lock, flags);
        chip->midi_full = 0;
-       if (chip->midi_out && !snd_rawmidi_transmit_empty(chip->midi_out)) {
+       if (!snd_rawmidi_transmit_empty(chip->midi_out)) {
                bytes = snd_rawmidi_transmit_peek(chip->midi_out, buf,
                                                  MIDI_OUT_BUFFER_SIZE - 1);
                DE_MID(("Try to send %d bytes...\n", bytes));
@@ -264,9 +264,11 @@ static void snd_echo_midi_output_trigger(struct 
snd_rawmidi_substream *substream
                }
        } else {
                if (chip->tinuse) {
-                       del_timer(&chip->timer);
                        chip->tinuse = 0;
+                       spin_unlock_irq(&chip->lock);
+                       del_timer_sync(&chip->timer);
                        DE_MID(("Timer removed\n"));
+                       return;
                }
        }
        spin_unlock_irq(&chip->lock);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to