summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinjie Du <duminjie@vivo.com>2023-07-12 13:18:37 +0200
committerKeith Busch <kbusch@kernel.org>2023-07-12 17:48:33 +0200
commit733ba346d941d37e0814bac37b6a5c188ac3c9b2 (patch)
tree6b5753ec2b11a948005cf5aac509130ed7cfcde9
parentnvme: warn only once for legacy uuid attribute (diff)
downloadlinux-733ba346d941d37e0814bac37b6a5c188ac3c9b2.tar.xz
linux-733ba346d941d37e0814bac37b6a5c188ac3c9b2.zip
nvme: fix parameter check in nvme_fault_inject_init()
Make IS_ERR() judge the debugfs_create_dir() function return. Signed-off-by: Minjie Du <duminjie@vivo.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r--drivers/nvme/host/fault_inject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/fault_inject.c b/drivers/nvme/host/fault_inject.c
index 83d2e6860d38..1ba10a5c656d 100644
--- a/drivers/nvme/host/fault_inject.c
+++ b/drivers/nvme/host/fault_inject.c
@@ -27,7 +27,7 @@ void nvme_fault_inject_init(struct nvme_fault_inject *fault_inj,
/* create debugfs directory and attribute */
parent = debugfs_create_dir(dev_name, NULL);
- if (!parent) {
+ if (IS_ERR(parent)) {
pr_warn("%s: failed to create debugfs directory\n", dev_name);
return;
}