Skip to content

Commit 733ba34

Browse files
Minjie Dukeithbusch
authored andcommitted
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>
1 parent b718ae8 commit 733ba34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/fault_inject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void nvme_fault_inject_init(struct nvme_fault_inject *fault_inj,
2727

2828
/* create debugfs directory and attribute */
2929
parent = debugfs_create_dir(dev_name, NULL);
30-
if (!parent) {
30+
if (IS_ERR(parent)) {
3131
pr_warn("%s: failed to create debugfs directory\n", dev_name);
3232
return;
3333
}

0 commit comments

Comments
 (0)