Commit 733ba346 authored by Minjie Du's avatar Minjie Du Committed by Keith Busch
Browse files

nvme: fix parameter check in nvme_fault_inject_init()



Make IS_ERR() judge the debugfs_create_dir() function return.

Signed-off-by: default avatarMinjie Du <duminjie@vivo.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent b718ae83
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}