Commit 2b666ca4 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: rawmidi: fix oops (use after free) when unloading a driver module
parents 2d019713 aa73aec6
...@@ -535,13 +535,15 @@ static int snd_rawmidi_release(struct inode *inode, struct file *file) ...@@ -535,13 +535,15 @@ static int snd_rawmidi_release(struct inode *inode, struct file *file)
{ {
struct snd_rawmidi_file *rfile; struct snd_rawmidi_file *rfile;
struct snd_rawmidi *rmidi; struct snd_rawmidi *rmidi;
struct module *module;
rfile = file->private_data; rfile = file->private_data;
rmidi = rfile->rmidi; rmidi = rfile->rmidi;
rawmidi_release_priv(rfile); rawmidi_release_priv(rfile);
kfree(rfile); kfree(rfile);
module = rmidi->card->module;
snd_card_file_remove(rmidi->card, file); snd_card_file_remove(rmidi->card, file);
module_put(rmidi->card->module); module_put(module);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment