diff options
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 | ||||
-rw-r--r-- | include/linux/libata.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 836947da5b14..7cc5a4a910a4 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -372,7 +372,7 @@ struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, | |||
372 | if (cmd->use_sg) { | 372 | if (cmd->use_sg) { |
373 | qc->__sg = (struct scatterlist *) cmd->request_buffer; | 373 | qc->__sg = (struct scatterlist *) cmd->request_buffer; |
374 | qc->n_elem = cmd->use_sg; | 374 | qc->n_elem = cmd->use_sg; |
375 | } else { | 375 | } else if (cmd->request_bufflen) { |
376 | qc->__sg = &qc->sgent; | 376 | qc->__sg = &qc->sgent; |
377 | qc->n_elem = 1; | 377 | qc->n_elem = 1; |
378 | } | 378 | } |
diff --git a/include/linux/libata.h b/include/linux/libata.h index e53a13ba7f78..65d318746ac6 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1149,6 +1149,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
1149 | qc->cursect = qc->cursg = qc->cursg_ofs = 0; | 1149 | qc->cursect = qc->cursg = qc->cursg_ofs = 0; |
1150 | qc->nsect = 0; | 1150 | qc->nsect = 0; |
1151 | qc->nbytes = qc->curbytes = 0; | 1151 | qc->nbytes = qc->curbytes = 0; |
1152 | qc->n_elem = 0; | ||
1152 | qc->err_mask = 0; | 1153 | qc->err_mask = 0; |
1153 | 1154 | ||
1154 | ata_tf_init(qc->dev, &qc->tf); | 1155 | ata_tf_init(qc->dev, &qc->tf); |