[SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.

We only map DMA when cmd->request_bufflen is non-zero for non-sg
buffers, we thus should make the same check when unmapping.

Based upon a report from Pasi Pirhonen.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2007-04-14 10:29:10 -07:00
parent d791d413fd
commit 8d3ee2cb0a

View File

@ -1281,7 +1281,7 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
(struct scatterlist *)Cmnd->request_buffer, (struct scatterlist *)Cmnd->request_buffer,
Cmnd->use_sg, Cmnd->use_sg,
Cmnd->sc_data_direction); Cmnd->sc_data_direction);
} else { } else if (Cmnd->request_bufflen) {
sbus_unmap_single(qpti->sdev, sbus_unmap_single(qpti->sdev,
(__u32)((unsigned long)Cmnd->SCp.ptr), (__u32)((unsigned long)Cmnd->SCp.ptr),
Cmnd->request_bufflen, Cmnd->request_bufflen,