[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20111122155507.af6c10e9.akpm@linux-foundation.org>
Date: Tue, 22 Nov 2011 15:55:07 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Wang Sheng-Hui <shhuiw@...il.com>
Cc: yinghai@...nel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm/memblock.c: return -ENOMEM instead of -ENXIO on
failure of debugfs_create_dir in memblock_init_debugfs
On Wed, 09 Nov 2011 10:01:26 +0800
Wang Sheng-Hui <shhuiw@...il.com> wrote:
> On the failure of debugfs_create_dir, we should return -ENOMEM
> instead of -ENXIO.
>
> The patch is against 3.1.
>
>
> Signed-off-by: Wang Sheng-Hui <shhuiw@...il.com>
> ---
> mm/memblock.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index ccbf973..4d4d5ee 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -852,7 +852,7 @@ static int __init memblock_init_debugfs(void)
> {
> struct dentry *root = debugfs_create_dir("memblock", NULL);
> if (!root)
> - return -ENXIO;
> + return -ENOMEM;
> debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
> debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);
Well, we don't know what we should return because
debugfs_create_file() is misdesigned - it should return an ERR_PTR.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists