From: Christoph Hellwig Date: Thu, 8 Oct 2020 20:06:10 +0000 (+0200) Subject: scsi: sr: Initialize ->cmd_len X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9120ac54cce6c37de7580d7567119d28c8988ebc;p=linux.git 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: 2ceda20f0a99 ("scsi: core: Move command size detection out of the fast path") Reported-by: Qian Cai Reported-by: Naresh Kamboju Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index b74dfd8dc1165..c20b439183789 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.