From: Clemens Ladisch Date: Fri, 15 Oct 2010 10:06:18 +0000 (+0200) Subject: ALSA: rawmidi: fix oops (use after free) when unloading a driver module X-Git-Tag: v2.6.36~12^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa73aec6c385e2c797ac25cc7ccf0318031de7c8;p=pandora-kernel.git ALSA: rawmidi: fix oops (use after free) when unloading a driver module When a driver module is unloaded and the last still open file is a raw MIDI device, the card and its devices will be actually freed in the snd_card_file_remove() call when that file is closed. Afterwards, rmidi and rmidi->card point into freed memory, so the module pointer is likely to be garbage. (This was introduced by commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a.) Signed-off-by: Clemens Ladisch Reported-by: Krzysztof Foltman Cc: 2.6.30-2.6.35 Signed-off-by: Takashi Iwai --- Reading git-diff-tree failed