linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sasikantha babu <sasikanth.v19@gmail.com>
To: Tejun Heo <tj@kernel.org>, "H. Peter Anvin" <hpa@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Sasikantha babu <sasikanth.v19@gmail.com>
Subject: [PATCH 2/2] mm: memblock - Handled failure of debug fs entries creation
Date: Thu, 26 Apr 2012 01:29:52 +0530	[thread overview]
Message-ID: <1335383992-19419-1-git-send-email-sasikanth.v19@gmail.com> (raw)

1) Removed already created debug fs entries on failure

2) Fixed coding style 80 char per line

Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
---
 mm/memblock.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index a44eab3..5553723 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -966,11 +966,19 @@ static int __init memblock_init_debugfs(void)
 {
 	struct dentry *root = debugfs_create_dir("memblock", NULL);
 	if (!root)
-		return -ENXIO;
-	debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
-	debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);
+		return -ENOMEM;
+
+	if (!debugfs_create_file("memory", S_IRUGO, root, &memblock.memory,
+				&memblock_debug_fops))
+		goto fail;
+	if (!debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved,
+				&memblock_debug_fops))
+		goto fail;
 
 	return 0;
+fail:
+	debugfs_remove_recursive(root);
+	return -ENOMEM;
 }
 __initcall(memblock_init_debugfs);
 
-- 
1.7.3.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2012-04-25 20:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 19:59 Sasikantha babu [this message]
2012-04-26 23:21 ` [PATCH 2/2] mm: memblock - Handled failure of debug fs entries creation Andrew Morton
2012-04-28 19:02   ` Sasikanth babu
2012-04-28 19:06     ` Andrew Morton
2012-04-28 19:45       ` Sasikanth babu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335383992-19419-1-git-send-email-sasikanth.v19@gmail.com \
    --to=sasikanth.v19@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).