diff options
author | Mark Lord <liml@rtr.ca> | 2005-12-12 23:19:28 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-12 23:19:28 -0500 |
commit | dfa159886f38344ede31e3b13ec614e0bebc09c6 (patch) | |
tree | 6c6128df37860c42acf00c0bd76797de940a306c /drivers/scsi | |
parent | 0e670506668a43e1355b8f10c33d081a676bd521 (diff) |
[PATCH] libata-core.c: fix parameter bug on kunmap_atomic() calls
Fix incorrect pointer usage on two calls to kunmap_atomic().
This seems to happen a lot, because kunmap() wants the struct page *,
whereas kunmap_atomic() instead wants the mapped virtual address.
Signed-off-by: Mark Lord <liml@rtr.ca>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libata-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 665ae79e1fd6..d0a0fdbd0fc4 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2443,7 +2443,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc) | |||
2443 | struct scatterlist *psg = &qc->pad_sgent; | 2443 | struct scatterlist *psg = &qc->pad_sgent; |
2444 | void *addr = kmap_atomic(psg->page, KM_IRQ0); | 2444 | void *addr = kmap_atomic(psg->page, KM_IRQ0); |
2445 | memcpy(addr + psg->offset, pad_buf, qc->pad_len); | 2445 | memcpy(addr + psg->offset, pad_buf, qc->pad_len); |
2446 | kunmap_atomic(psg->page, KM_IRQ0); | 2446 | kunmap_atomic(addr, KM_IRQ0); |
2447 | } | 2447 | } |
2448 | } else { | 2448 | } else { |
2449 | if (sg_dma_len(&sg[0]) > 0) | 2449 | if (sg_dma_len(&sg[0]) > 0) |
@@ -2717,7 +2717,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc) | |||
2717 | if (qc->tf.flags & ATA_TFLAG_WRITE) { | 2717 | if (qc->tf.flags & ATA_TFLAG_WRITE) { |
2718 | void *addr = kmap_atomic(psg->page, KM_IRQ0); | 2718 | void *addr = kmap_atomic(psg->page, KM_IRQ0); |
2719 | memcpy(pad_buf, addr + psg->offset, qc->pad_len); | 2719 | memcpy(pad_buf, addr + psg->offset, qc->pad_len); |
2720 | kunmap_atomic(psg->page, KM_IRQ0); | 2720 | kunmap_atomic(addr, KM_IRQ0); |
2721 | } | 2721 | } |
2722 | 2722 | ||
2723 | sg_dma_address(psg) = ap->pad_dma + (qc->tag * ATA_DMA_PAD_SZ); | 2723 | sg_dma_address(psg) = ap->pad_dma + (qc->tag * ATA_DMA_PAD_SZ); |