aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2020-10-08 22:06:10 +0200
committerMartin K. Petersen <[email protected]>2020-10-08 16:23:09 -0400
commit9120ac54cce6c37de7580d7567119d28c8988ebc (patch)
tree3861568beb905fb1854ff31d36281db687253d95
parentc881fb5cd5ffc407f78878cc43ce13699946844d (diff)
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/[email protected] Fixes: 2ceda20f0a99 ("scsi: core: Move command size detection out of the fast path") Reported-by: Qian Cai <[email protected]> Reported-by: Naresh Kamboju <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
-rw-r--r--drivers/scsi/sr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index b74dfd8dc116..c20b43918378 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -503,6 +503,7 @@ static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt)
SCpnt->transfersize = cd->device->sector_size;
SCpnt->underflow = this_count << 9;
SCpnt->allowed = MAX_RETRIES;
+ SCpnt->cmd_len = 10;
/*
* This indicates that the command is ready from our end to be queued.