scsi: qla2xxx: Fix NULL vs IS_ERR() bug for debugfs_create_dir()
[ Upstream commit d0b0822e32dbae80bbcb3cc86f34d28539d913df ]
Since both debugfs_create_dir() and debugfs_create_file() return ERR_PTR
and never NULL, use IS_ERR() instead of checking for NULL.
Fixes: 1e98fb0f92
("scsi: qla2xxx: Setup debugfs entries for remote ports")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230831140930.3166359-1-ruanjinjie@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
82910aa550
commit
ae889fffae
@@ -116,7 +116,7 @@ qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp)
|
|||||||
|
|
||||||
sprintf(wwn, "pn-%016llx", wwn_to_u64(fp->port_name));
|
sprintf(wwn, "pn-%016llx", wwn_to_u64(fp->port_name));
|
||||||
fp->dfs_rport_dir = debugfs_create_dir(wwn, vha->dfs_rport_root);
|
fp->dfs_rport_dir = debugfs_create_dir(wwn, vha->dfs_rport_root);
|
||||||
if (!fp->dfs_rport_dir)
|
if (IS_ERR(fp->dfs_rport_dir))
|
||||||
return;
|
return;
|
||||||
if (NVME_TARGET(vha->hw, fp))
|
if (NVME_TARGET(vha->hw, fp))
|
||||||
debugfs_create_file("dev_loss_tmo", 0600, fp->dfs_rport_dir,
|
debugfs_create_file("dev_loss_tmo", 0600, fp->dfs_rport_dir,
|
||||||
@@ -571,14 +571,14 @@ create_nodes:
|
|||||||
if (IS_QLA27XX(ha) || IS_QLA83XX(ha) || IS_QLA28XX(ha)) {
|
if (IS_QLA27XX(ha) || IS_QLA83XX(ha) || IS_QLA28XX(ha)) {
|
||||||
ha->tgt.dfs_naqp = debugfs_create_file("naqp",
|
ha->tgt.dfs_naqp = debugfs_create_file("naqp",
|
||||||
0400, ha->dfs_dir, vha, &dfs_naqp_ops);
|
0400, ha->dfs_dir, vha, &dfs_naqp_ops);
|
||||||
if (!ha->tgt.dfs_naqp) {
|
if (IS_ERR(ha->tgt.dfs_naqp)) {
|
||||||
ql_log(ql_log_warn, vha, 0xd011,
|
ql_log(ql_log_warn, vha, 0xd011,
|
||||||
"Unable to create debugFS naqp node.\n");
|
"Unable to create debugFS naqp node.\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vha->dfs_rport_root = debugfs_create_dir("rports", ha->dfs_dir);
|
vha->dfs_rport_root = debugfs_create_dir("rports", ha->dfs_dir);
|
||||||
if (!vha->dfs_rport_root) {
|
if (IS_ERR(vha->dfs_rport_root)) {
|
||||||
ql_log(ql_log_warn, vha, 0xd012,
|
ql_log(ql_log_warn, vha, 0xd012,
|
||||||
"Unable to create debugFS rports node.\n");
|
"Unable to create debugFS rports node.\n");
|
||||||
goto out;
|
goto out;
|
||||||
|
Reference in New Issue
Block a user