From: Peter Osterlund Date: Tue, 21 Feb 2006 02:28:01 +0000 (-0800) Subject: [PATCH] pktcdvd: Correctly set rq->cmd_len in pkt_generic_packet() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cef289633a9321cd99dd5f6cc935657dc487e9f0;p=openwrt%2Fstaging%2Fblogic.git [PATCH] pktcdvd: Correctly set rq->cmd_len in pkt_generic_packet() 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 93e44d0292ab..f40310a42ba1 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -58,6 +58,7 @@ #include #include #include +#include #include @@ -380,6 +381,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * 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;