[GIT PULL] sound fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Takashi Iwai
Date: Sunday, October 17, 2010 - 8:25 am

Linus,

please pull a sound fix for v2.6.36 from:

  git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git fix/misc

This is a trivial fix of a long-standing use-after-free bug below.

Thanks!


Takashi

===

Clemens Ladisch (1):
      ALSA: rawmidi: fix oops (use after free) when unloading a driver module

---
 sound/core/rawmidi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index a7868ad..cbbed0d 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -535,13 +535,15 @@ static int snd_rawmidi_release(struct inode *inode, struct file *file)
 {
 	struct snd_rawmidi_file *rfile;
 	struct snd_rawmidi *rmidi;
+	struct module *module;
 
 	rfile = file->private_data;
 	rmidi = rfile->rmidi;
 	rawmidi_release_priv(rfile);
 	kfree(rfile);
+	module = rmidi->card->module;
 	snd_card_file_remove(rmidi->card, file);
-	module_put(rmidi->card->module);
+	module_put(module);
 	return 0;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PULL] sound fix, Takashi Iwai, (Sun Oct 17, 8:25 am)