Commit 90396f96 authored by KAMEZAWA Hiroyuki's avatar KAMEZAWA Hiroyuki Committed by Linus Torvalds

kcore: more fixes for init

proc_kcore_init() doesn't check NULL case.  fix it and remove unnecessary
comments.
Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 81ac3ad9
...@@ -606,6 +606,10 @@ static int __init proc_kcore_init(void) ...@@ -606,6 +606,10 @@ static int __init proc_kcore_init(void)
{ {
proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, proc_root_kcore = proc_create("kcore", S_IRUSR, NULL,
&proc_kcore_operations); &proc_kcore_operations);
if (!proc_root_kcore) {
printk(KERN_ERR "couldn't create /proc/kcore\n");
return 0; /* Always returns 0. */
}
/* Store text area if it's special */ /* Store text area if it's special */
proc_kcore_text_init(); proc_kcore_text_init();
/* Store vmalloc area */ /* Store vmalloc area */
...@@ -615,7 +619,6 @@ static int __init proc_kcore_init(void) ...@@ -615,7 +619,6 @@ static int __init proc_kcore_init(void)
/* Store direct-map area from physical memory map */ /* Store direct-map area from physical memory map */
kcore_update_ram(); kcore_update_ram();
hotplug_memory_notifier(kcore_callback, 0); hotplug_memory_notifier(kcore_callback, 0);
/* Other special area, area-for-module etc is arch specific. */
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment