Skip to contentSkip to conversation

nfcsim.c: Fix error checking for debugfs_create_dir

PATCH New Osama Muhammad 1 participant 1 message May 24, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfcsim.c: Fix error checking for debugfs_create_dir

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

---
 drivers/nfc/nfcsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/nfcsim.c +1 -1
index 44eeb17ae48d..3b377704e2b5 100644
@@ -337,7 +337,7 @@ static void nfcsim_debugfs_init(void)
 {
 	nfcsim_debugfs_root = debugfs_create_dir("nfcsim", NULL);
 
-	if (!nfcsim_debugfs_root)
+	if (IS_ERR(nfcsim_debugfs_root))
 		pr_err("Could not create debugfs entry\n");
 
 }
Signature · 1 line
2.34.1