Skip to content

Commit

Permalink
Merge branch 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Oct 17, 2010
2 parents 2d01971 + aa73aec commit 2b666ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/core/rawmidi.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2b666ca

Please sign in to comment.