]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.53/scsi-lpfc-add-check-for-loss-of-ndlp-when-sending-rr.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.19.53 / scsi-lpfc-add-check-for-loss-of-ndlp-when-sending-rr.patch
CommitLineData
2289b8c5
SL
1From 8e801179e64f5e636bf838292db11f99c5b46279 Mon Sep 17 00:00:00 2001
2From: James Smart <jsmart2021@gmail.com>
3Date: Mon, 6 May 2019 17:26:49 -0700
4Subject: scsi: lpfc: add check for loss of ndlp when sending RRQ
5
6[ Upstream commit c8cb261a072c88ca1aff0e804a30db4c7606521b ]
7
8There was a missing qualification of a valid ndlp structure when calling to
9send an RRQ for an abort. Add the check.
10
11Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
12Signed-off-by: James Smart <jsmart2021@gmail.com>
13Tested-by: Bart Van Assche <bvanassche@acm.org>
14Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
15Signed-off-by: Sasha Levin <sashal@kernel.org>
16---
17 drivers/scsi/lpfc/lpfc_els.c | 5 ++++-
18 1 file changed, 4 insertions(+), 1 deletion(-)
19
20diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
21index 0d214e6b8e9a..f3c6801c0b31 100644
22--- a/drivers/scsi/lpfc/lpfc_els.c
23+++ b/drivers/scsi/lpfc/lpfc_els.c
24@@ -7094,7 +7094,10 @@ int
25 lpfc_send_rrq(struct lpfc_hba *phba, struct lpfc_node_rrq *rrq)
26 {
27 struct lpfc_nodelist *ndlp = lpfc_findnode_did(rrq->vport,
28- rrq->nlp_DID);
29+ rrq->nlp_DID);
30+ if (!ndlp)
31+ return 1;
32+
33 if (lpfc_test_rrq_active(phba, ndlp, rrq->xritag))
34 return lpfc_issue_els_rrq(rrq->vport, ndlp,
35 rrq->nlp_DID, rrq);
36--
372.20.1
38