* [PATCH] mm/memblock: validate the creation of debugfs files
@ 2015-08-14 19:08 Alexander Kuleshov
2015-08-14 19:08 ` [PATCH] misc/mei: Fix debugfs filename in error output Alexander Kuleshov
2015-08-14 19:13 ` [PATCH] mm/memblock: validate the creation of debugfs files Alexander Kuleshov
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Kuleshov @ 2015-08-14 19:08 UTC (permalink / raw)
To: Tomas Winkler; +Cc: linux-kernel, Alexander Kuleshov
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
mm/memblock.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 87108e7..c09e911 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1692,16 +1692,34 @@ static const struct file_operations memblock_debug_fops = {
static int __init memblock_init_debugfs(void)
{
+ struct dentry *f;
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);
+
+ f = debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
+ if (!f) {
+ pr_err("Failed to create memory debugfs file\n");
+ goto err_out;
+ }
+
+ f = debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);
+ if (!f) {
+ pr_err("Failed to create reserved debugfs file\n");
+ goto err_out;
+ }
+
#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
- debugfs_create_file("physmem", S_IRUGO, root, &memblock.physmem, &memblock_debug_fops);
+ f = debugfs_create_file("physmem", S_IRUGO, root, &memblock.physmem, &memblock_debug_fops);
+ if (!f) {
+ pr_err("Failed to create physmem debugfs file\n");
+ goto err_out;
+ }
#endif
return 0;
+err_out:
+ return -ENOMEM;
}
__initcall(memblock_init_debugfs);
--
2.5.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] misc/mei: Fix debugfs filename in error output
2015-08-14 19:08 [PATCH] mm/memblock: validate the creation of debugfs files Alexander Kuleshov
@ 2015-08-14 19:08 ` Alexander Kuleshov
2015-08-14 19:13 ` [PATCH] mm/memblock: validate the creation of debugfs files Alexander Kuleshov
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Kuleshov @ 2015-08-14 19:08 UTC (permalink / raw)
To: Tomas Winkler; +Cc: linux-kernel, Alexander Kuleshov
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
drivers/misc/mei/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index eb86834..5e3a588 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -207,7 +207,7 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name)
f = debugfs_create_file("active", S_IRUSR, dir,
dev, &mei_dbgfs_fops_active);
if (!f) {
- dev_err(dev->dev, "meclients: registration failed\n");
+ dev_err(dev->dev, "active: registration failed\n");
goto err;
}
f = debugfs_create_file("devstate", S_IRUSR, dir,
--
2.5.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mm/memblock: validate the creation of debugfs files
2015-08-14 19:08 [PATCH] mm/memblock: validate the creation of debugfs files Alexander Kuleshov
2015-08-14 19:08 ` [PATCH] misc/mei: Fix debugfs filename in error output Alexander Kuleshov
@ 2015-08-14 19:13 ` Alexander Kuleshov
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Kuleshov @ 2015-08-14 19:13 UTC (permalink / raw)
To: Tomas Winkler; +Cc: linux-kernel
On 08-15-15, Alexander Kuleshov wrote:
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
> mm/memblock.c | 24 +++++++++++++++++++++---
> 1 file changed, 21 insertions(+), 3 deletions(-)
>
Sorry for noise, skip the first patch please.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-14 19:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-14 19:08 [PATCH] mm/memblock: validate the creation of debugfs files Alexander Kuleshov
2015-08-14 19:08 ` [PATCH] misc/mei: Fix debugfs filename in error output Alexander Kuleshov
2015-08-14 19:13 ` [PATCH] mm/memblock: validate the creation of debugfs files Alexander Kuleshov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®