Skip to content

Commit d0b0822

Browse files
Jinjie Ruanmartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix NULL vs IS_ERR() bug for debugfs_create_dir()
Since both debugfs_create_dir() and debugfs_create_file() return ERR_PTR and never NULL, use IS_ERR() instead of checking for NULL. Fixes: 1e98fb0 ("scsi: qla2xxx: Setup debugfs entries for remote ports") Signed-off-by: Jinjie Ruan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 59f10a0 commit d0b0822

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/qla2xxx/qla_dfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp)
116116

117117
sprintf(wwn, "pn-%016llx", wwn_to_u64(fp->port_name));
118118
fp->dfs_rport_dir = debugfs_create_dir(wwn, vha->dfs_rport_root);
119-
if (!fp->dfs_rport_dir)
119+
if (IS_ERR(fp->dfs_rport_dir))
120120
return;
121121
if (NVME_TARGET(vha->hw, fp))
122122
debugfs_create_file("dev_loss_tmo", 0600, fp->dfs_rport_dir,
@@ -708,14 +708,14 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)
708708
if (IS_QLA27XX(ha) || IS_QLA83XX(ha) || IS_QLA28XX(ha)) {
709709
ha->tgt.dfs_naqp = debugfs_create_file("naqp",
710710
0400, ha->dfs_dir, vha, &dfs_naqp_ops);
711-
if (!ha->tgt.dfs_naqp) {
711+
if (IS_ERR(ha->tgt.dfs_naqp)) {
712712
ql_log(ql_log_warn, vha, 0xd011,
713713
"Unable to create debugFS naqp node.\n");
714714
goto out;
715715
}
716716
}
717717
vha->dfs_rport_root = debugfs_create_dir("rports", ha->dfs_dir);
718-
if (!vha->dfs_rport_root) {
718+
if (IS_ERR(vha->dfs_rport_root)) {
719719
ql_log(ql_log_warn, vha, 0xd012,
720720
"Unable to create debugFS rports node.\n");
721721
goto out;

0 commit comments

Comments
 (0)