Blob Blame History Raw
From 08cf51e5506021ec563608334a2cdafc7a97d6e7 Mon Sep 17 00:00:00 2001
From: Himanshu Madhani <hmadhani@redhat.com>
Date: Thu, 3 Oct 2019 15:44:18 -0400
Subject: [PATCH 124/124] [scsi] scsi: qla2xxx: Use correct size in call to
 dma_free_coherent() in qla2400_sp_unmap()

Message-id: <20191003154418.34113-1-hmadhani@redhat.com>
Patchwork-id: 276604
O-Subject: [RHEL7.8 e-stor PATCH] scsi: qla2xxx: Use correct size in call to dma_free_coherent() in qla2400_sp_unmap()
Bugzilla: 1668767
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: Jerry Snitselaar <jsnitsel@redhat.com>
RH-Acked-by: Ewan Milne <emilne@redhat.com>
RH-Acked-by: Laurence Oberman <loberman@redhat.com>

Bugzilla: 1668767

Brewbuild:
https://brewweb.devel.redhat.com/taskinfo?taskID=23831253

Testing:
Verified by Customer and RedHat/Marvell engineers.

This patch matches code upstream which was resolved
as merge conflict by Linus.

Upstream-status: RHEL-only

Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 drivers/scsi/qla2xxx/qla_gs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index d8ffc03431d4..23976623af7b 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -3169,7 +3169,7 @@ void qla24xx_sp_unmap(scsi_qla_host_t *vha, srb_t *sp)
 	default:
 		if (sp->u.iocb_cmd.u.ctarg.req) {
 			dma_free_coherent(&vha->hw->pdev->dev,
-			    sizeof(struct ct_sns_pkt),
+			    sp->u.iocb_cmd.u.ctarg.req_allocated_size,
 			    sp->u.iocb_cmd.u.ctarg.req,
 			    sp->u.iocb_cmd.u.ctarg.req_dma);
 			sp->u.iocb_cmd.u.ctarg.req = NULL;
@@ -3177,7 +3177,7 @@ void qla24xx_sp_unmap(scsi_qla_host_t *vha, srb_t *sp)
 
 		if (sp->u.iocb_cmd.u.ctarg.rsp) {
 			dma_free_coherent(&vha->hw->pdev->dev,
-			    sizeof(struct ct_sns_pkt),
+			    sp->u.iocb_cmd.u.ctarg.rsp_allocated_size,
 			    sp->u.iocb_cmd.u.ctarg.rsp,
 			    sp->u.iocb_cmd.u.ctarg.rsp_dma);
 			sp->u.iocb_cmd.u.ctarg.rsp = NULL;
-- 
2.13.6