aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/megasas.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/scsi/megasas.c')
-rw-r--r--hw/scsi/megasas.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 52a41239cf..ca62952941 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -461,9 +461,12 @@ static void megasas_unmap_frame(MegasasState *s, MegasasCmd *cmd)
{
PCIDevice *p = PCI_DEVICE(s);
- pci_dma_unmap(p, cmd->frame, cmd->pa_size, 0, 0);
+ if (cmd->pa_size) {
+ pci_dma_unmap(p, cmd->frame, cmd->pa_size, 0, 0);
+ }
cmd->frame = NULL;
cmd->pa = 0;
+ cmd->pa_size = 0;
clear_bit(cmd->index, s->frame_map);
}