mirror of https://gitee.com/openkylin/linux.git
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
This commit is contained in:
commit
2b666ca4a6
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue