patch-2.4.11-dontuse linux/drivers/sound/midibuf.c

Next file: linux/drivers/sound/mpu401.c
Previous file: linux/drivers/sound/maui.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.10/linux/drivers/sound/midibuf.c linux/drivers/sound/midibuf.c
@@ -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);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)