aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ncr53c8xx.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-06-03 07:21:13 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-06 11:07:25 -0400
commit5d5ff44fe6775ccb922fd1f7d478b2ba9ca95068 (patch)
treed8569caefe1cb5ecced30929ef98d3e1fe642425 /drivers/scsi/ncr53c8xx.c
parente4a082c7c1f9a7b11fece6918e7ee5519b39ac46 (diff)
[SCSI] fix up request buffer reference in various scsi drivers
Various scsi drivers use scsi_cmnd.buffer and scsi_cmnd.bufflen in their queuecommand functions. Those fields are internal storage for the midlayer only and are used to restore the original payload after request_buffer and request_bufflen have been overwritten for EH. Using the buffer and bufflen fields means they do very broken things in error handling. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ncr53c8xx.c')
-rw-r--r--drivers/scsi/ncr53c8xx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 22f913127f08..6ab035590ee6 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -529,7 +529,7 @@ static void __unmap_scsi_data(struct device *dev, struct scsi_cmnd *cmd)
529{ 529{
530 switch(cmd->__data_mapped) { 530 switch(cmd->__data_mapped) {
531 case 2: 531 case 2:
532 dma_unmap_sg(dev, cmd->buffer, cmd->use_sg, 532 dma_unmap_sg(dev, cmd->request_buffer, cmd->use_sg,
533 cmd->sc_data_direction); 533 cmd->sc_data_direction);
534 break; 534 break;
535 case 1: 535 case 1:
@@ -564,7 +564,7 @@ static int __map_scsi_sg_data(struct device *dev, struct scsi_cmnd *cmd)
564 if (cmd->use_sg == 0) 564 if (cmd->use_sg == 0)
565 return 0; 565 return 0;
566 566
567 use_sg = dma_map_sg(dev, cmd->buffer, cmd->use_sg, 567 use_sg = dma_map_sg(dev, cmd->request_buffer, cmd->use_sg,
568 cmd->sc_data_direction); 568 cmd->sc_data_direction);
569 cmd->__data_mapped = 2; 569 cmd->__data_mapped = 2;
570 cmd->__data_mapping = use_sg; 570 cmd->__data_mapping = use_sg;
@@ -7697,7 +7697,7 @@ static int ncr_scatter(struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd)
7697 if (!use_sg) 7697 if (!use_sg)
7698 segment = ncr_scatter_no_sglist(np, cp, cmd); 7698 segment = ncr_scatter_no_sglist(np, cp, cmd);
7699 else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) { 7699 else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) {
7700 struct scatterlist *scatter = (struct scatterlist *)cmd->buffer; 7700 struct scatterlist *scatter = (struct scatterlist *)cmd->request_buffer;
7701 struct scr_tblmove *data; 7701 struct scr_tblmove *data;
7702 7702
7703 if (use_sg > MAX_SCATTER) { 7703 if (use_sg > MAX_SCATTER) {