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>
This commit is contained in:
parent
b718ae835b
commit
733ba346d9
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user