summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2007-01-17 12:32:12 -0600
committerJeff Garzik <jeff@garzik.org>2007-01-24 02:04:34 -0500
commit7a801184fa480e11e6431f184a5bdf31f63326fb (patch)
treeb68cc5daee76cc564f7f48cc038f52be4a855be7 /drivers
parent07c53dac4904206a50dd7c87adabbb1acff903fb (diff)
downloadtalos-op-linux-7a801184fa480e11e6431f184a5bdf31f63326fb.tar.gz
talos-op-linux-7a801184fa480e11e6431f184a5bdf31f63326fb.zip
libata: Fixup n_elem initialization
Fixup the inialization of qc->n_elem. It currently gets initialized to 1 for commands that do not transfer any data. Fix this by initializing n_elem to 0 and only setting to 1 in ata_scsi_qc_new when there is data to transfer. This fixes some problems seen with SATA devices attached to ipr adapters. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-scsi.c2
1 files changed, 1 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,
if (cmd->use_sg) {
qc->__sg = (struct scatterlist *) cmd->request_buffer;
qc->n_elem = cmd->use_sg;
- } else {
+ } else if (cmd->request_bufflen) {
qc->__sg = &qc->sgent;
qc->n_elem = 1;
}
OpenPOWER on IntegriCloud