[GIT PULL] sound fix

From: Takashi Iwai
Date: Sun Oct 17 2010 - 11:26:11 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/