scsi: libsas: fix ata xfer length
[pandora-kernel.git] / drivers / scsi / libsas / sas_ata.c
index 5e170e3..33e0c18 100644 (file)
@@ -205,7 +205,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
                task->num_scatter = qc->n_elem;
        } else {
                for_each_sg(qc->sg, sg, qc->n_elem, si)
                task->num_scatter = qc->n_elem;
        } else {
                for_each_sg(qc->sg, sg, qc->n_elem, si)
-                       xfer += sg->length;
+                       xfer += sg_dma_len(sg);
 
                task->total_xfer_len = xfer;
                task->num_scatter = si;
 
                task->total_xfer_len = xfer;
                task->num_scatter = si;