Skip to contentSkip to conversation

lpfc: Fix dma virtual address ptr assignment in bsg

PATCH Applied James Smart 2 participants 2 messages Apr 21, 2021 – Apr 27, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lpfc: Fix dma virtual address ptr assignment in bsg

lpfc_bsg_ct_unsol_event routine acts assigns a ct_request to the wrong structure address, resulting in a bad address that results in bsg related timeouts.

Correct the ct_request assignment to use the kernel virtual buffer address (not the control structure address).

---
 drivers/scsi/lpfc/lpfc_bsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_bsg.c +1 -1
index c2776b88d493..38cfe1bc6a4d 100644
@@ -934,7 +934,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
 	INIT_LIST_HEAD(&head);
 	list_add_tail(&head, &piocbq->list);
 
-	ct_req = (struct lpfc_sli_ct_request *)bdeBuf1;
+	ct_req = (struct lpfc_sli_ct_request *)bdeBuf1->virt;
 	evt_req_id = ct_req->FsType;
 	cmd = ct_req->CommandResponse.bits.CmdRsp;
 
Signature · 1 line
2.26.2
#1 lore raw
Quoted 6 lines · James Smart

lpfc_bsg_ct_unsol_event routine acts assigns a ct_request to the wrong structure address, resulting in a bad address that results in bsg related timeouts.

Correct the ct_request assignment to use the kernel virtual buffer address (not the control structure address).

Applied to 5.13/scsi-fixes, thanks!

[1/1] lpfc: Fix dma virtual address ptr assignment in bsg

      https://git.kernel.org/mkp/scsi/c/83adbba746d1
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering