Skip to content

Commit e166baf

Browse files
Haoxiang Limartinkpetersen
authored andcommitted
scsi: hpsa: Fix DMA mapping leak on IOACCEL2 reset path
If phys_disk->in_reset is set, the function returns directly without undoing the resources acquired for the command. Add the missing error cleanup by unmapping the IOACCEL2 SG chain block when needed, unmapping the SCSI command, and dropping the outstanding IOACCEL command count before returning. Fixes: c5dfd10 ("scsi: hpsa: correct device resets") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Acked-by: Don Brace <don.brace@microchip.com> Link: https://patch.msgid.link/20260622160028.1240496-1-haoxiang_li2024@163.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 2c007ac commit e166baf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/scsi/hpsa.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5017,6 +5017,10 @@ static int hpsa_scsi_ioaccel2_queue_command(struct ctlr_info *h,
50175017

50185018
if (phys_disk->in_reset) {
50195019
cmd->result = DID_RESET << 16;
5020+
atomic_dec(&phys_disk->ioaccel_cmds_out);
5021+
scsi_dma_unmap(cmd);
5022+
if (use_sg > h->ioaccel_maxsg)
5023+
hpsa_unmap_ioaccel2_sg_chain_block(h, cp);
50205024
return -1;
50215025
}
50225026

0 commit comments

Comments
 (0)