Skip to contentSkip to conversation

SCSI: add missing cdb clearing in scsi_execute()

PATCH New Tejun Heo 1 participant 1 message Dec 16, 2006

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 SCSI: add missing cdb clearing in scsi_execute()

Clear-garbage-after-CDB patch missed scsi_execute() and it causes some ODDs (HL-DT-ST DVD-RAM GSA-H30N) choke during SCSI scan. Note that this patch is only for -stable. There is another more reliable fix for this problem proposed for devel tree.

http://thread.gmane.org/gmane.linux.ide/14605/focus=14605

drivers/scsi/scsi_lib.c +1 -0
index 1748e27..644f711 100644
@@ -191,6 +191,7 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
 		goto out;
 
 	req->cmd_len = COMMAND_SIZE(cmd[0]);
+	memset(req->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
 	memcpy(req->cmd, cmd, req->cmd_len);
 	req->sense = sense;
 	req->sense_len = 0;