[PATCH] Fix incorrect kunmap_atomic in pktcdvd

From: Peter Osterlund
Date: Sat Oct 23 2004 - 12:32:45 EST


The pktcdvd driver uses kunmap_atomic() incorrectly. The function is
supposed to take an address as the first parameter, but the pktcdvd
driver passed a page pointer. Thanks to Douglas Gilbert and Jens Axboe
for discovering this.

Signed-off-by: Peter Osterlund <petero2@xxxxxxxxx>
---

linux-petero/drivers/block/pktcdvd.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/block/pktcdvd.c~packet-kmap-fix drivers/block/pktcdvd.c
--- linux/drivers/block/pktcdvd.c~packet-kmap-fix 2004-10-23 12:04:01.000000000 +0200
+++ linux-petero/drivers/block/pktcdvd.c 2004-10-23 12:07:11.000000000 +0200
@@ -621,7 +621,7 @@ static void pkt_copy_bio_data(struct bio

BUG_ON(len < 0);
memcpy(vto, vfrom, len);
- kunmap_atomic(src_bvl->bv_page, KM_USER0);
+ kunmap_atomic(vfrom, KM_USER0);

seg++;
offs = 0;
@@ -649,7 +649,7 @@ static void pkt_make_local_copy(struct p
void *vfrom = kmap_atomic(pages[f], KM_USER0) + offsets[f];
void *vto = page_address(pkt->pages[p]) + offs;
memcpy(vto, vfrom, CD_FRAMESIZE);
- kunmap_atomic(pages[f], KM_USER0);
+ kunmap_atomic(vfrom, KM_USER0);
pages[f] = pkt->pages[p];
offsets[f] = offs;
} else {
_

--
Peter Osterlund - petero2@xxxxxxxxx
http://w1.894.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/