lkml.org 
[lkml]   [2001]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Midi close race
The patch below fixes a race condition when closing the MIDI input device. The
previous code left the timer running while freeing buffers used by the timer
routine, leading to frequent OOPSes. Thomas: you seem to have been the last
person to touch this file. Any comments?

--- 1.1/drivers/sound/midibuf.c Sat Jan 6 07:28:25 2001
+++ 1.2/drivers/sound/midibuf.c Thu Jun 14 16:33:40 2001
@@ -253,13 +253,13 @@

midi_devs[dev]->close(dev);

+ if (open_devs < 2)
+ del_timer(&poll_timer);
+ open_devs--;
vfree(midi_in_buf[dev]);
vfree(midi_out_buf[dev]);
midi_in_buf[dev] = NULL;
midi_out_buf[dev] = NULL;
- if (open_devs < 2)
- del_timer(&poll_timer);;
- open_devs--;

if (midi_devs[dev]->owner)
__MOD_DEC_USE_COUNT (midi_devs[dev]->owner);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.021 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site