From: Denis V. Lunev Date: Tue, 29 Apr 2008 08:02:13 +0000 (-0700) Subject: sound: use non-racy method for /proc/driver/snd-page-alloc creation X-Git-Tag: firefly_0821_release~20945 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7bf4e6d3e948e38893c718fa9c5bd0dfbfa49670;p=firefly-linux-kernel-4.4.55.git 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: Denis V. Lunev Cc: Alexey Dobriyan Cc: "Eric W. Biederman" Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 920e5780c228..23b7bc02728b 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -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; }