提交 7bf4e6d3 编写于 作者: D Denis V. Lunev 提交者: Linus Torvalds

sound: use non-racy method for /proc/driver/snd-page-alloc creation

Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to
main tree.
Signed-off-by: NDenis V. Lunev <den@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 3d71f86f
......@@ -629,9 +629,8 @@ static const struct file_operations snd_mem_proc_fops = {
static int __init snd_mem_init(void)
{
#ifdef CONFIG_PROC_FS
snd_mem_proc = create_proc_entry(SND_MEM_PROC_FILE, 0644, NULL);
if (snd_mem_proc)
snd_mem_proc->proc_fops = &snd_mem_proc_fops;
snd_mem_proc = proc_create(SND_MEM_PROC_FILE, 0644, NULL,
&snd_mem_proc_fops);
#endif
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册