linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Cox <adrian@humboldt.co.uk>
To: linux-kernel@vger.kernel.org
Cc: sailer@scs.ch
Subject: [PATCH] Midi close race
Date: Fri, 21 Sep 2001 11:04:10 +0100	[thread overview]
Message-ID: <20010921110410.B17701@gallimaufry.freeserve.co.uk> (raw)

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);

             reply	other threads:[~2001-09-21 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-21 10:04 Adrian Cox [this message]
2001-09-21 10:38 [PATCH] Midi close race Studierende der Universitaet des Saarlandes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010921110410.B17701@gallimaufry.freeserve.co.uk \
    --to=adrian@humboldt.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sailer@scs.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).