[PATCH] Race fix for MIDI, take 2

Adrian Cox (adrian@humboldt.co.uk)
Mon, 24 Sep 2001 10:49:16 +0100


Here's my second go at a race fix for drivers/sound/midibuf.c. Given how
unreliable it was before, I wonder if I was the only person using it.

Please apply.

- Adrian

--- 1.1/drivers/sound/midibuf.c Sat Jan 6 07:28:25 2001
+++ 1.3/drivers/sound/midibuf.c Mon Sep 24 10:30:28 2001
@@ -253,13 +253,13 @@

midi_devs[dev]->close(dev);

+ open_devs--;
+ if (open_devs == 0)
+ del_timer_sync(&poll_timer);
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/