linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@suse.de>
Subject: [PATCH] Fix incorrect kunmap_atomic in pktcdvd
Date: 23 Oct 2004 19:31:18 +0200	[thread overview]
Message-ID: <m3wtxhibo9.fsf@telia.com> (raw)

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

             reply	other threads:[~2004-10-23 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-23 17:31 Peter Osterlund [this message]
2004-10-24 10:25 ` [PATCH] Fix incorrect kunmap_atomic in pktcdvd 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3wtxhibo9.fsf@telia.com \
    --to=petero2@telia.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).