Re: [PATCH 1/3][mmotm] kcore: more fixes for init

From: AmÃrico Wang
Date: Thu Sep 17 2009 - 01:55:30 EST


On Thu, Sep 17, 2009 at 10:42 AM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
>
> proc_kcore_init() doesn't check NULL case.
> fix it and remove unnecessary comments.
>
> Cc: WANG Cong <xiyou.wangcong@xxxxxxxxx>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

Acked-by: WANG Cong <xiyou.wangcong@xxxxxxxxx>

Thanks.

> ---
> Âfs/proc/kcore.c | Â Â5 ++++-
> Â1 file changed, 4 insertions(+), 1 deletion(-)
>
> Index: mmotm-2.6.31-Sep14/fs/proc/kcore.c
> ===================================================================
> --- mmotm-2.6.31-Sep14.orig/fs/proc/kcore.c
> +++ mmotm-2.6.31-Sep14/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;
> Â}
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/