]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.
authorDavid S. Miller <davem@davemloft.net>
Thu, 19 Apr 2007 23:31:17 +0000 (01:31 +0200)
committerAdrian Bunk <bunk@stusta.de>
Thu, 19 Apr 2007 23:31:17 +0000 (01:31 +0200)
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>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/scsi/qlogicpti.c

index 1fd5fc6d0fe3fb7fe1e8fb6c297fd3e9ef709a20..d3854ee537f5ce0655d1a0d396768213a7257b55 100644 (file)
@@ -1451,7 +1451,7 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
                                      (struct scatterlist *)Cmnd->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,