Skip to content

Commit 7dcc683

Browse files
Jinjie Ruanmartinkpetersen
authored andcommitted
scsi: lpfc: Fix the NULL vs IS_ERR() bug for debugfs_create_file()
Since debugfs_create_file() returns ERR_PTR and never NULL, use IS_ERR() to check the return value. Fixes: 2fcbc56 ("scsi: lpfc: Make debugfs ktime stats generic for NVME and SCSI") Fixes: 4c47efc ("scsi: lpfc: Move SCSI and NVME Stats to hardware queue structures") Fixes: 6a828b0 ("scsi: lpfc: Support non-uniform allocation of MSIX vectors to hardware queues") Fixes: 95bfc6d ("scsi: lpfc: Make FW logging dynamically configurable") Fixes: 9f77870 ("scsi: lpfc: Add debugfs support for cm framework buffers") Fixes: c490850 ("scsi: lpfc: Adapt partitioned XRI lists to efficient sharing") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230906030809.2847970-1-ruanjinjie@huawei.com Reviewed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent d14e3e5 commit 7dcc683

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/scsi/lpfc/lpfc_debugfs.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6073,7 +6073,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
60736073
phba->hba_debugfs_root,
60746074
phba,
60756075
&lpfc_debugfs_op_multixripools);
6076-
if (!phba->debug_multixri_pools) {
6076+
if (IS_ERR(phba->debug_multixri_pools)) {
60776077
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
60786078
"0527 Cannot create debugfs multixripools\n");
60796079
goto debug_failed;
@@ -6085,7 +6085,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
60856085
debugfs_create_file(name, S_IFREG | 0644,
60866086
phba->hba_debugfs_root,
60876087
phba, &lpfc_cgn_buffer_op);
6088-
if (!phba->debug_cgn_buffer) {
6088+
if (IS_ERR(phba->debug_cgn_buffer)) {
60896089
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
60906090
"6527 Cannot create debugfs "
60916091
"cgn_buffer\n");
@@ -6098,7 +6098,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
60986098
debugfs_create_file(name, S_IFREG | 0644,
60996099
phba->hba_debugfs_root,
61006100
phba, &lpfc_rx_monitor_op);
6101-
if (!phba->debug_rx_monitor) {
6101+
if (IS_ERR(phba->debug_rx_monitor)) {
61026102
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
61036103
"6528 Cannot create debugfs "
61046104
"rx_monitor\n");
@@ -6111,7 +6111,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
61116111
debugfs_create_file(name, 0644,
61126112
phba->hba_debugfs_root,
61136113
phba, &lpfc_debugfs_ras_log);
6114-
if (!phba->debug_ras_log) {
6114+
if (IS_ERR(phba->debug_ras_log)) {
61156115
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
61166116
"6148 Cannot create debugfs"
61176117
" ras_log\n");
@@ -6132,7 +6132,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
61326132
debugfs_create_file(name, S_IFREG | 0644,
61336133
phba->hba_debugfs_root,
61346134
phba, &lpfc_debugfs_op_lockstat);
6135-
if (!phba->debug_lockstat) {
6135+
if (IS_ERR(phba->debug_lockstat)) {
61366136
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
61376137
"4610 Can't create debugfs lockstat\n");
61386138
goto debug_failed;
@@ -6358,7 +6358,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
63586358
debugfs_create_file(name, 0644,
63596359
vport->vport_debugfs_root,
63606360
vport, &lpfc_debugfs_op_scsistat);
6361-
if (!vport->debug_scsistat) {
6361+
if (IS_ERR(vport->debug_scsistat)) {
63626362
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
63636363
"4611 Cannot create debugfs scsistat\n");
63646364
goto debug_failed;
@@ -6369,7 +6369,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
63696369
debugfs_create_file(name, 0644,
63706370
vport->vport_debugfs_root,
63716371
vport, &lpfc_debugfs_op_ioktime);
6372-
if (!vport->debug_ioktime) {
6372+
if (IS_ERR(vport->debug_ioktime)) {
63736373
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
63746374
"0815 Cannot create debugfs ioktime\n");
63756375
goto debug_failed;

0 commit comments

Comments
 (0)