mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix incorrect kunmap_atomic in pktcdvd
@ 2004-10-23 17:31 Peter Osterlund
  2004-10-24 10:25 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Osterlund @ 2004-10-23 17:31 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Jens Axboe

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@telia.com>
---

 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@telia.com
http://w1.894.telia.com/~u89404340

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-24 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-23 17:31 [PATCH] Fix incorrect kunmap_atomic in pktcdvd Peter Osterlund
2004-10-24 10:25 ` Andrew Morton
2004-10-24 11:14   ` Peter Osterlund
2004-10-24 11:18     ` Andrew Morton
2004-10-24 13:21       ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome