dtivers: ntb: fix parameter check in perf_setup_dbgfs()
authorMinjie Du <duminjie@vivo.com>
Thu, 13 Jul 2023 03:47:27 +0000 (11:47 +0800)
committerJon Mason <jdmason@kudzu.us>
Fri, 18 Aug 2023 13:50:06 +0000 (09:50 -0400)
Make IS_ERR() judge the debugfs_create_dir() function return
in perf_setup_dbgfs().

Signed-off-by: Minjie Du <duminjie@vivo.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/test/ntb_perf.c

index 65e1e5cf1b29a6dd0b0573e263f273d7644c2754..553f1f46bc664ff92295320001cabe7266010c88 100644 (file)
@@ -1355,7 +1355,7 @@ static void perf_setup_dbgfs(struct perf_ctx *perf)
        struct pci_dev *pdev = perf->ntb->pdev;
 
        perf->dbgfs_dir = debugfs_create_dir(pci_name(pdev), perf_dbgfs_topdir);
-       if (!perf->dbgfs_dir) {
+       if (IS_ERR(perf->dbgfs_dir)) {
                dev_warn(&perf->ntb->dev, "DebugFS unsupported\n");
                return;
        }