patch-2.4.0-test7 linux/drivers/sound/midibuf.c

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

diff -u --recursive --new-file v2.4.0-test6/linux/drivers/sound/midibuf.c linux/drivers/sound/midibuf.c
@@ -172,6 +172,9 @@
 	 *    Interrupts disabled. Be careful
 	 */
 
+	if (midi_devs[dev]->owner)
+		__MOD_INC_USE_COUNT (midi_devs[dev]->owner);
+
 	if ((err = midi_devs[dev]->open(dev, mode,
 				 midi_input_intr, midi_output_intr)) < 0)
 		return err;
@@ -257,6 +260,9 @@
 	if (open_devs < 2)
 		del_timer(&poll_timer);;
 	open_devs--;
+
+	if (midi_devs[dev]->owner)
+		__MOD_DEC_USE_COUNT (midi_devs[dev]->owner);
 }
 
 int MIDIbuf_write(int dev, struct file *file, const char *buf, int count)

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