From: Minjie Du <duminjie@vivo.com>
To: Jon Mason <jdmason@kudzu.us>, Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <allenbh@gmail.com>, Minjie Du <duminjie@vivo.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
ntb@lists.linux.dev (open list:NTB DRIVER CORE),
linux-kernel@vger.kernel.org (open list)
Cc: opensource.kernel@vivo.com
Subject: [PATCH v1] dtivers: ntb: fix parameter check in perf_setup_dbgfs()
Date: Thu, 13 Jul 2023 11:47:27 +0800 [thread overview]
Message-ID: <20230713034728.2157-1-duminjie@vivo.com> (raw)
Make IS_ERR() judge the debugfs_create_dir() function return
in perf_setup_dbgfs().
Signed-off-by: Minjie Du <duminjie@vivo.com>
---
drivers/ntb/test/ntb_perf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 65e1e5cf1..553f1f46b 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -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;
}
--
2.39.0
next reply other threads:[~2023-07-13 3:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 3:47 Minjie Du [this message]
2023-07-13 15:05 ` [PATCH] drivers: ntb: fix parameter check in perf_setup_dbgfs() Markus Elfring
2023-08-13 14:48 ` [PATCH v1] dtivers: " Serge Semin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230713034728.2157-1-duminjie@vivo.com \
--to=duminjie@vivo.com \
--cc=allenbh@gmail.com \
--cc=dave.jiang@intel.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=ntb@lists.linux.dev \
--cc=opensource.kernel@vivo.com \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).