]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/scsi-lpfc-add-check-for-loss-of-ndlp-when-sending-rr.patch
Fix up backported ptrace patch
[thirdparty/kernel/stable-queue.git] / queue-4.14 / scsi-lpfc-add-check-for-loss-of-ndlp-when-sending-rr.patch
1 From ea32a0df00cb3601b88c38b322dc19bec06d41f9 Mon Sep 17 00:00:00 2001
2 From: James Smart <jsmart2021@gmail.com>
3 Date: Mon, 6 May 2019 17:26:49 -0700
4 Subject: scsi: lpfc: add check for loss of ndlp when sending RRQ
5
6 [ Upstream commit c8cb261a072c88ca1aff0e804a30db4c7606521b ]
7
8 There was a missing qualification of a valid ndlp structure when calling to
9 send an RRQ for an abort. Add the check.
10
11 Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
12 Signed-off-by: James Smart <jsmart2021@gmail.com>
13 Tested-by: Bart Van Assche <bvanassche@acm.org>
14 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
15 Signed-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
20 diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
21 index 57cddbc4a977..ddd29752d96d 100644
22 --- a/drivers/scsi/lpfc/lpfc_els.c
23 +++ b/drivers/scsi/lpfc/lpfc_els.c
24 @@ -7065,7 +7065,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 --
37 2.20.1
38