]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix lpfc_force_rscn ndlp kref imbalance
authorJames Smart <jsmart2021@gmail.com>
Sat, 4 Dec 2021 00:26:38 +0000 (16:26 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 7 Dec 2021 03:35:36 +0000 (22:35 -0500)
commite611f180fe4ffdc91a4ba67ffd9b1d49bb7e3427
tree680c1a131575fd7a97e992266896b51c4734b15a
parentcdaa80e4f759afad8f6951a6caf24acb1423afbc
scsi: lpfc: Fix lpfc_force_rscn ndlp kref imbalance

Issuing lpfc_force_rscn twice results in an ndlp kref use-after-free call
trace.

A prior patch reworked the get/put handling by ensuring nlp_get was done
before WQE submission and a put was done in the completion path.
Unfortunately, the issue_els_rscn path had a piece of legacy code that did
a nlp_put, causing an imbalance on the ref counts.

Fixed by removing the unnecessary legacy code snippet.

Link: https://lore.kernel.org/r/20211204002644.116455-4-jsmart2021@gmail.com
Fixes: 881570427668 ("scsi: lpfc: Rework locations of ndlp reference taking")
Cc: <stable@vger.kernel.org> # v5.11+
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>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_els.c