Skip to contentSkip to conversation

sound fix

GIT PULL Takashi Iwai 1 participant 1 message Oct 17, 2010 Sound

lore
Share & tools
lore
#0 lore raw

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(-)
sound/core/rawmidi.c +3 -1
index a7868ad..cbbed0d 100644
@@ -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;
 }