[PATCH 1/5] pktcdvd: Correctly set rq->cmd_len in pkt_generic_packet()

From: Peter Osterlund
Date: Sun Feb 19 2006 - 10:55:01 EST


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@xxxxxxxxx>
---

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@xxxxxxxxx
http://web.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/