mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[ALSA] Handle file operations during snd_card disconnects using static file->f_op
Alsa used to kmalloc one file->f_op per file per disconnecting snd_card. This led to oopses sometimes when file->f_op was freed before __fput() finished. Patch adds a virtual device for disconnect: VDD. VDD consists of: LIST_HEAD(shutdown_files) protected by DEFINE_SPINLOCK(shutdown_mutex) static struct file_operations snd_shutdown_f_ops and functions assigned to it Additions to struct snd_monitor_file to specify if instance is hidden by VDD or not. A VDD's instance is created in snd_card_disconnect() under the card->files_lock. cleaned up in snd_card_file_remove() under the card->files_lock. Signed-off-by: Karsten Wiese <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]>
This commit is contained in:
parent
4130d59b1a
commit
a9edfc6022
2 changed files with 54 additions and 42 deletions
|
|
@ -89,10 +89,10 @@ struct snd_device {
|
|||
struct snd_monitor_file {
|
||||
struct file *file;
|
||||
struct snd_monitor_file *next;
|
||||
const struct file_operations *disconnected_f_op;
|
||||
struct list_head shutdown_list;
|
||||
};
|
||||
|
||||
struct snd_shutdown_f_ops; /* define it later in init.c */
|
||||
|
||||
/* main structure for soundcard */
|
||||
|
||||
struct snd_card {
|
||||
|
|
|
|||
Loading…
Reference in a new issue