diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 2dc3264..fa82151 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -286,6 +286,7 @@ static int sg_io(struct file *file, requ * fill in request structure */ rq->cmd_len = hdr->cmd_len; + memset(rq->cmd, 0, BLK_MAX_CDB); memcpy(rq->cmd, cmd, hdr->cmd_len); if (sizeof(rq->cmd) != hdr->cmd_len) memset(rq->cmd + hdr->cmd_len, 0, sizeof(rq->cmd) - hdr->cmd_len); diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index d2c02df..080c2ed 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -410,6 +410,7 @@ int scsi_execute_async(struct scsi_devic goto free_req; req->cmd_len = cmd_len; + memset(req->cmd, 0, BLK_MAX_CDB); memcpy(req->cmd, cmd, req->cmd_len); req->sense = sioc->sense; req->sense_len = 0;