From: David S. Miller Date: Sat, 14 Apr 2007 17:29:10 +0000 (-0700) Subject: [SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something. X-Git-Tag: v2.6.21-rc7~7^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=8d3ee2cb0ab59f78fdc801ede7db15ef47387bd0;p=linux-2.6-omap-h63xx.git [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 --- diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index 9b827ceec50..9f10689905a 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c @@ -1281,7 +1281,7 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti) (struct scatterlist *)Cmnd->request_buffer, Cmnd->use_sg, Cmnd->sc_data_direction); - } else { + } else if (Cmnd->request_bufflen) { sbus_unmap_single(qpti->sdev, (__u32)((unsigned long)Cmnd->SCp.ptr), Cmnd->request_bufflen,