提交 2b666ca4 编写于 作者: L 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
...@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册