nvme: Fix debugfs_create_dir error checking
PATCH 1/1 nvme: Fix debugfs_create_dir error checking
The debugfs_create_dir function returns ERR_PTR in case of error and the correct way to check an error is 'IS_ERR' inline function.
This patch will replace the null-comparison with IS_ERR
Signed-off-by Atul Raut <[email protected]>
--- drivers/nvme/host/fault_inject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fault_inject.c +1 -1
@@ -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 ; }
Signature · 1 line
2.34.1
Quoted 8 lines · Atul Raut
The
debugfs_create_dirfunction returnsERR_PTRin case of error and the correct way to check an error is 'IS_ERR' inline function.
This patch will replace the null-comparison withIS_ERRSigned-off-by Atul Raut <[email protected]>---
Looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>
-ck