mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ras:debugfs.c: Fix error checking for debugfs_create_dir
@ 2023-05-16 18:29 Osama Muhammad
  2023-05-16 19:25 ` [tip: ras/core] ras/debugfs: Fix error checking for debugfs_create_dir() tip-bot2 for Osama Muhammad
  0 siblings, 1 reply; 2+ messages in thread
From: Osama Muhammad @ 2023-05-16 18:29 UTC (permalink / raw)
  To: tony.luck, bp; +Cc: linux-edac, linux-kernel, Osama Muhammad

This patch fixes the error checking in debugfs.c in debugfs_create_dir.
The correct way to check if an error occurred is 'IS_ERR' inline function.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
 drivers/ras/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ras/debugfs.c b/drivers/ras/debugfs.c
index f0a6391b1146..ffb973c328e3 100644
--- a/drivers/ras/debugfs.c
+++ b/drivers/ras/debugfs.c
@@ -46,7 +46,7 @@ int __init ras_add_daemon_trace(void)
 
 	fentry = debugfs_create_file("daemon_active", S_IRUSR, ras_debugfs_dir,
 				     NULL, &trace_fops);
-	if (!fentry)
+	if (IS_ERR(fentry))
 		return -ENODEV;
 
 	return 0;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip: ras/core] ras/debugfs: Fix error checking for debugfs_create_dir()
  2023-05-16 18:29 [PATCH] ras:debugfs.c: Fix error checking for debugfs_create_dir Osama Muhammad
@ 2023-05-16 19:25 ` tip-bot2 for Osama Muhammad
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Osama Muhammad @ 2023-05-16 19:25 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Osama Muhammad, Borislav Petkov (AMD), x86, linux-kernel

The following commit has been merged into the ras/core branch of tip:

Commit-ID:     2a1d18a5dc5056825b8e9527d188130da6256efc
Gitweb:        https://git.kernel.org/tip/2a1d18a5dc5056825b8e9527d188130da6256efc
Author:        Osama Muhammad <osmtendev@gmail.com>
AuthorDate:    Tue, 16 May 2023 23:29:27 +05:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 16 May 2023 21:12:23 +02:00

ras/debugfs: Fix error checking for debugfs_create_dir()

Check the return value of debugfs_create_dir() properly.

  [ bp: Rewrite commit message. ]

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230516182927.9171-1-osmtendev@gmail.com
---
 drivers/ras/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ras/debugfs.c b/drivers/ras/debugfs.c
index f0a6391..ffb973c 100644
--- a/drivers/ras/debugfs.c
+++ b/drivers/ras/debugfs.c
@@ -46,7 +46,7 @@ int __init ras_add_daemon_trace(void)
 
 	fentry = debugfs_create_file("daemon_active", S_IRUSR, ras_debugfs_dir,
 				     NULL, &trace_fops);
-	if (!fentry)
+	if (IS_ERR(fentry))
 		return -ENODEV;
 
 	return 0;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-16 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16 18:29 [PATCH] ras:debugfs.c: Fix error checking for debugfs_create_dir Osama Muhammad
2023-05-16 19:25 ` [tip: ras/core] ras/debugfs: Fix error checking for debugfs_create_dir() tip-bot2 for Osama Muhammad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome