diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 67f412bb497..325270b520e 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1090,6 +1090,8 @@ static struct scsi_cmnd *scsi_get_cmd_from_req(struct scsi_device *sdev, | |||
1090 | cmd->tag = req->tag; | 1090 | cmd->tag = req->tag; |
1091 | cmd->request = req; | 1091 | cmd->request = req; |
1092 | 1092 | ||
1093 | cmd->cmnd = req->cmd; | ||
1094 | |||
1093 | return cmd; | 1095 | return cmd; |
1094 | } | 1096 | } |
1095 | 1097 | ||
@@ -1127,8 +1129,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req) | |||
1127 | req->buffer = NULL; | 1129 | req->buffer = NULL; |
1128 | } | 1130 | } |
1129 | 1131 | ||
1130 | BUILD_BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd)); | ||
1131 | memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); | ||
1132 | cmd->cmd_len = req->cmd_len; | 1132 | cmd->cmd_len = req->cmd_len; |
1133 | if (!req->data_len) | 1133 | if (!req->data_len) |
1134 | cmd->sc_data_direction = DMA_NONE; | 1134 | cmd->sc_data_direction = DMA_NONE; |
@@ -1165,6 +1165,7 @@ int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req) | |||
1165 | if (unlikely(!cmd)) | 1165 | if (unlikely(!cmd)) |
1166 | return BLKPREP_DEFER; | 1166 | return BLKPREP_DEFER; |
1167 | 1167 | ||
1168 | memset(cmd->cmnd, 0, BLK_MAX_CDB); | ||
1168 | return scsi_init_io(cmd, GFP_ATOMIC); | 1169 | return scsi_init_io(cmd, GFP_ATOMIC); |
1169 | } | 1170 | } |
1170 | EXPORT_SYMBOL(scsi_setup_fs_cmnd); | 1171 | EXPORT_SYMBOL(scsi_setup_fs_cmnd); |