From: KAMEZAWA Hiroyuki Date: Tue, 22 Sep 2009 23:45:50 +0000 (-0700) Subject: kcore: more fixes for init X-Git-Tag: MMI-PSA29.97-13-9~26575 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=90396f96b7da0e2305ffe0266d22b6f8221f28ba;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git kcore: more fixes for init proc_kcore_init() doesn't check NULL case. fix it and remove unnecessary comments. Signed-off-by: KAMEZAWA Hiroyuki Acked-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index c6a5ec731972..70733780fdd9 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -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 */ @@ -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; }