Skip to content

Commit 9120ac5

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: sr: Initialize ->cmd_len
Ensure the command length is properly set. Previously the command code tried to find this out using the command opcode. Link: https://lore.kernel.org/r/20201008200611.1818099-2-hch@lst.de Fixes: 2ceda20 ("scsi: core: Move command size detection out of the fast path") Reported-by: Qian Cai <cai@redhat.com> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent c881fb5 commit 9120ac5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/scsi/sr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt)
503503
SCpnt->transfersize = cd->device->sector_size;
504504
SCpnt->underflow = this_count << 9;
505505
SCpnt->allowed = MAX_RETRIES;
506+
SCpnt->cmd_len = 10;
506507

507508
/*
508509
* This indicates that the command is ready from our end to be queued.

0 commit comments

Comments
 (0)