diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4afef5cdcb17..097888721ec4 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1215,12 +1215,12 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1215 | } else { | 1215 | } else { |
1216 | memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); | 1216 | memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); |
1217 | cmd->cmd_len = req->cmd_len; | 1217 | cmd->cmd_len = req->cmd_len; |
1218 | if (rq_data_dir(req) == WRITE) | 1218 | if (!req->data_len) |
1219 | cmd->sc_data_direction = DMA_NONE; | ||
1220 | else if (rq_data_dir(req) == WRITE) | ||
1219 | cmd->sc_data_direction = DMA_TO_DEVICE; | 1221 | cmd->sc_data_direction = DMA_TO_DEVICE; |
1220 | else if (req->data_len) | ||
1221 | cmd->sc_data_direction = DMA_FROM_DEVICE; | ||
1222 | else | 1222 | else |
1223 | cmd->sc_data_direction = DMA_NONE; | 1223 | cmd->sc_data_direction = DMA_FROM_DEVICE; |
1224 | 1224 | ||
1225 | cmd->transfersize = req->data_len; | 1225 | cmd->transfersize = req->data_len; |
1226 | cmd->allowed = 3; | 1226 | cmd->allowed = 3; |