From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>, Justin Tee <justin.tee@broadcom.com>
Subject: [PATCH 08/11] lpfc: Fix crash when lpfc_sli4_hba_setup fails to initialize the SGLs
Date: Fri, 14 May 2021 12:55:56 -0700 [thread overview]
Message-ID: <20210514195559.119853-9-jsmart2021@gmail.com> (raw)
In-Reply-To: <20210514195559.119853-1-jsmart2021@gmail.com>
The driver is encountering a crash in lpfc_free_iocb_list() while
performing initial attachment.
Code review found this to be an errant failure path that was taken,
jumping to a tag that then referenced structures that were
uninitialized.
Fix the failure path.
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
drivers/scsi/lpfc/lpfc_sli.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index fa4722c7a551..1ad1beb2a8a8 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -7964,7 +7964,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
"0393 Error %d during rpi post operation\n",
rc);
rc = -ENODEV;
- goto out_destroy_queue;
+ goto out_free_iocblist;
}
lpfc_sli4_node_prep(phba);
@@ -8130,8 +8130,9 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
out_unset_queue:
/* Unset all the queues set up in this routine when error out */
lpfc_sli4_queue_unset(phba);
-out_destroy_queue:
+out_free_iocblist:
lpfc_free_iocb_list(phba);
+out_destroy_queue:
lpfc_sli4_queue_destroy(phba);
out_stop_timers:
lpfc_stop_hba_timers(phba);
--
2.26.2
next prev parent reply other threads:[~2021-05-14 19:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-14 19:55 [PATCH 00/11] lpfc: Update lpfc to revision 12.8.0.10 James Smart
2021-05-14 19:55 ` [PATCH 01/11] lpfc: Fix unreleased RPIs when NPIV ports are created James Smart
2021-05-14 19:55 ` [PATCH 02/11] lpfc: Fix non-optimized ERSP handling James Smart
2021-05-14 19:55 ` [PATCH 03/11] lpfc: Fix "Unexpected timeout" error in direct attach topology James Smart
2021-05-14 19:55 ` [PATCH 04/11] lpfc: Add ndlp kref accounting for resume rpi path James Smart
2021-05-14 19:55 ` [PATCH 05/11] lpfc: Fix Node recovery when driver is handling simultaneous PLOGIs James Smart
2021-05-14 19:55 ` [PATCH 06/11] lpfc: Fix node handling for Fabric Controller and Domain Controller James Smart
2021-05-14 19:55 ` [PATCH 07/11] lpfc: Ignore GID-FT response that may be received after a link flip James Smart
2021-05-14 19:55 ` James Smart [this message]
2021-05-14 19:55 ` [PATCH 09/11] lpfc: Add a option to enable interlocked ABTS before job completion James Smart
2021-05-14 19:55 ` [PATCH 10/11] lpfc: Reregister FPIN types if receive ELS_RDF from fabric controller James Smart
2021-05-14 19:55 ` [PATCH 11/11] lpfc: Update lpfc version to 12.8.0.10 James Smart
2021-05-22 3:23 ` [PATCH 00/11] lpfc: Update lpfc to revision 12.8.0.10 Martin K. Petersen
2021-05-26 4:07 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210514195559.119853-9-jsmart2021@gmail.com \
--to=jsmart2021@gmail.com \
--cc=justin.tee@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox