Skip to content

Commit

Permalink
kcore: more fixes for init
Browse files Browse the repository at this point in the history
proc_kcore_init() doesn't check NULL case.  fix it and remove unnecessary
comments.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Sep 23, 2009
1 parent 81ac3ad commit 90396f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/proc/kcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ static int __init proc_kcore_init(void)
{
proc_root_kcore = proc_create("kcore", S_IRUSR, NULL,
&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 */
proc_kcore_text_init();
/* Store vmalloc area */
Expand All @@ -615,7 +619,6 @@ static int __init proc_kcore_init(void)
/* Store direct-map area from physical memory map */
kcore_update_ram();
hotplug_memory_notifier(kcore_callback, 0);
/* Other special area, area-for-module etc is arch specific. */

return 0;
}
Expand Down

0 comments on commit 90396f9

Please sign in to comment.