[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230712124035.7981-1-machel@vivo.com>
Date: Wed, 12 Jul 2023 20:39:59 +0800
From: Wang Ming <machel@...o.com>
To: Jon Mason <jdmason@...zu.us>, Dave Jiang <dave.jiang@...el.com>,
Allen Hubbe <allenbh@...il.com>,
Serge Semin <fancer.lancer@...il.com>,
Dan Carpenter <error27@...il.com>,
Jiasheng Jiang <jiasheng@...as.ac.cn>,
Wang Ming <machel@...o.com>, ntb@...ts.linux.dev,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [PATCH v2] ntb:Fix an NULL vs IS_ERR() bug for debugfs_create_dir() in tool_setup_dbgfs()
The debugfs_create_dir() function returns error pointers.
It never returns NULL. Most incorrect error checks were fixed,
but the one in tool_setup_dbgfs() was forgotten.
Fix the remaining error check.
Signed-off-by: Wang Ming <machel@...o.com>
---
drivers/ntb/test/ntb_tool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ntb/test/ntb_tool.c b/drivers/ntb/test/ntb_tool.c
index eeeb4b1c97d2..4fa69ea4331d 100644
--- a/drivers/ntb/test/ntb_tool.c
+++ b/drivers/ntb/test/ntb_tool.c
@@ -1495,7 +1495,7 @@ static void tool_setup_dbgfs(struct tool_ctx *tc)
tc->dbgfs_dir = debugfs_create_dir(dev_name(&tc->ntb->dev),
tool_dbgfs_topdir);
- if (!tc->dbgfs_dir)
+ if (IS_ERR(tc->dbgfs_dir))
return;
debugfs_create_file("port", 0600, tc->dbgfs_dir,
--
2.25.1
Powered by blists - more mailing lists