+ lib-debugobjects-no-need-to-check-return-value-of-debugfs_create-functions.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib: debugobjects: no need to check return value of debugfs_create functions
has been added to the -mm tree.  Its filename is
     lib-debugobjects-no-need-to-check-return-value-of-debugfs_create-functions.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-debugobjects-no-need-to-check-return-value-of-debugfs_create-functions.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-debugobjects-no-need-to-check-return-value-of-debugfs_create-functions.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Subject: lib: debugobjects: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the return
value.  The function can work or not, but the code logic should never do
something different based on this.

Link: http://lkml.kernel.org/r/20190612153513.GA21082@xxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Reviewed-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>
Cc: Qian Cai <cai@xxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Waiman Long <longman@xxxxxxxxxx>
Cc: Zhong Jiang <zhongjiang@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/debugobjects.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

--- a/lib/debugobjects.c~lib-debugobjects-no-need-to-check-return-value-of-debugfs_create-functions
+++ a/lib/debugobjects.c
@@ -868,26 +868,16 @@ static const struct file_operations debu
 
 static int __init debug_objects_init_debugfs(void)
 {
-	struct dentry *dbgdir, *dbgstats;
+	struct dentry *dbgdir;
 
 	if (!debug_objects_enabled)
 		return 0;
 
 	dbgdir = debugfs_create_dir("debug_objects", NULL);
-	if (!dbgdir)
-		return -ENOMEM;
 
-	dbgstats = debugfs_create_file("stats", 0444, dbgdir, NULL,
-				       &debug_stats_fops);
-	if (!dbgstats)
-		goto err;
+	debugfs_create_file("stats", 0444, dbgdir, NULL, &debug_stats_fops);
 
 	return 0;
-
-err:
-	debugfs_remove(dbgdir);
-
-	return -ENOMEM;
 }
 __initcall(debug_objects_init_debugfs);
 
_

Patches currently in -mm which might be from gregkh@xxxxxxxxxxxxxxxxxxx are

lib-debugobjects-no-need-to-check-return-value-of-debugfs_create-functions.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux