aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/image
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/usb/image
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/usb/image')
-rw-r--r--drivers/usb/image/microtek.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 2a0e18a48748..b2bafc37c414 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -513,7 +513,7 @@ static void mts_do_sg (struct urb* transfer, struct pt_regs *regs)
513 mts_transfer_cleanup(transfer); 513 mts_transfer_cleanup(transfer);
514 } 514 }
515 515
516 sg = context->srb->buffer; 516 sg = context->srb->request_buffer;
517 context->fragment++; 517 context->fragment++;
518 mts_int_submit_urb(transfer, 518 mts_int_submit_urb(transfer,
519 context->data_pipe, 519 context->data_pipe,
@@ -549,19 +549,19 @@ mts_build_transfer_context( Scsi_Cmnd *srb, struct mts_desc* desc )
549 desc->context.fragment = 0; 549 desc->context.fragment = 0;
550 550
551 if (!srb->use_sg) { 551 if (!srb->use_sg) {
552 if ( !srb->bufflen ){ 552 if ( !srb->request_bufflen ){
553 desc->context.data = NULL; 553 desc->context.data = NULL;
554 desc->context.data_length = 0; 554 desc->context.data_length = 0;
555 return; 555 return;
556 } else { 556 } else {
557 desc->context.data = srb->buffer; 557 desc->context.data = srb->request_buffer;
558 desc->context.data_length = srb->bufflen; 558 desc->context.data_length = srb->request_bufflen;
559 MTS_DEBUG("length = %d or %d\n", 559 MTS_DEBUG("length = %d or %d\n",
560 srb->request_bufflen, srb->bufflen); 560 srb->request_bufflen, srb->bufflen);
561 } 561 }
562 } else { 562 } else {
563 MTS_DEBUG("Using scatter/gather\n"); 563 MTS_DEBUG("Using scatter/gather\n");
564 sg = srb->buffer; 564 sg = srb->request_buffer;
565 desc->context.data = page_address(sg[0].page) + sg[0].offset; 565 desc->context.data = page_address(sg[0].page) + sg[0].offset;
566 desc->context.data_length = sg[0].length; 566 desc->context.data_length = sg[0].length;
567 } 567 }