public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] pktcdvd: Correctly set rq->cmd_len in pkt_generic_packet()
Date: 19 Feb 2006 16:50:59 +0100	[thread overview]
Message-ID: <m37j7rbb4s.fsf@telia.com> (raw)

It looks like the code in pkt_generic_packet() worked by luck in the
past, but after commit 186d330e682210100c671355580a8592e4a21692
leaving rq->cmd_len uninitialized doesn't work any more.

Signed-off-by: Peter Osterlund <petero2@telia.com>
---

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

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index f783af7..5276d66 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -59,6 +59,7 @@
 #include <linux/mutex.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_ioctl.h>
+#include <scsi/scsi.h>
 
 #include <asm/uaccess.h>
 
@@ -381,6 +382,7 @@ static int pkt_generic_packet(struct pkt
 	memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE);
 	if (sizeof(rq->cmd) > CDROM_PACKET_SIZE)
 		memset(rq->cmd + CDROM_PACKET_SIZE, 0, sizeof(rq->cmd) - CDROM_PACKET_SIZE);
+	rq->cmd_len = COMMAND_SIZE(rq->cmd[0]);
 
 	rq->ref_count++;
 	rq->flags |= REQ_NOMERGE;

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

             reply	other threads:[~2006-02-19 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-19 15:50 Peter Osterlund [this message]
2006-02-19 15:53 ` [PATCH 2/5] pktcdvd: Rename functions and make their return values sane Peter Osterlund
2006-02-19 15:56   ` [PATCH 3/5] pktcdvd: Remove useless printk statements Peter Osterlund
2006-02-19 15:58     ` [PATCH 4/5] pktcdvd: Fix the logic in the pkt_writable_track function Peter Osterlund
2006-02-19 16:00       ` [PATCH 5/5] pktcdvd: Only return -EROFS when appropriate Peter Osterlund

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=m37j7rbb4s.fsf@telia.com \
    --to=petero2@telia.com \
    --cc=akpm@osdl.org \
    --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