mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
[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 186d330e68
leaving rq->cmd_len
uninitialized doesn't work any more.
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
aa657ca924
commit
cef289633a
1 changed files with 2 additions and 0 deletions
|
@ -58,6 +58,7 @@
|
|||
#include <linux/suspend.h>
|
||||
#include <scsi/scsi_cmnd.h>
|
||||
#include <scsi/scsi_ioctl.h>
|
||||
#include <scsi/scsi.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue