lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1335383992-19419-1-git-send-email-sasikanth.v19@gmail.com>
Date:	Thu, 26 Apr 2012 01:29:52 +0530
From:	Sasikantha babu <sasikanth.v19@...il.com>
To:	Tejun Heo <tj@...nel.org>, "H. Peter Anvin" <hpa@...ux.intel.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Sasikantha babu <sasikanth.v19@...il.com>
Subject: [PATCH 2/2] mm: memblock - Handled failure of debug fs entries creation

1) Removed already created debug fs entries on failure

2) Fixed coding style 80 char per line

Signed-off-by: Sasikantha babu <sasikanth.v19@...il.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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ