[ros-diffs] [janderwald] 55089: [USBSTOR] - Fix attempt #2 the offset bug - fix identation

janderwald at svn.reactos.org janderwald at svn.reactos.org
Mon Jan 23 02:58:52 UTC 2012


Author: janderwald
Date: Mon Jan 23 02:58:52 2012
New Revision: 55089

URL: http://svn.reactos.org/svn/reactos?rev=55089&view=rev
Log:
[USBSTOR]
- Fix attempt #2  the offset bug
- fix identation

Modified:
    branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c

Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c
URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c?rev=55089&r1=55088&r2=55089&view=diff
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c [iso-8859-1] Mon Jan 23 02:58:52 2012
@@ -589,12 +589,16 @@
                 if (CommandLength == UFI_READ_WRITE_CMD_LEN)
                 {
                     MdlVirtualAddress = MmGetMdlVirtualAddress(OriginalRequest->MdlAddress);
+
+                    //
+                    // is there an offset
+                    //
                     if (MdlVirtualAddress != Context->TransferData)
-					{
+                    {
                         //
                         // lets build an mdl
                         //
-						Context->TransferBufferMDL = IoAllocateMdl(Context->TransferData, MmGetMdlByteCount(OriginalRequest->MdlAddress), FALSE, FALSE, NULL);
+                        Context->TransferBufferMDL = IoAllocateMdl(Context->TransferData, MmGetMdlByteCount(OriginalRequest->MdlAddress), FALSE, FALSE, NULL);
                         if (!Context->TransferBufferMDL)
                         {
                             //
@@ -603,17 +607,20 @@
                             return STATUS_INSUFFICIENT_RESOURCES;
                         }
 
-						//
-						// now build the partial mdl
-						//
-						IoBuildPartialMdl(OriginalRequest->MdlAddress, Context->TransferBufferMDL, Context->TransferData, Context->TransferDataLength);
-					}
+                        //
+                        // now build the partial mdl
+                        //
+                        IoBuildPartialMdl(OriginalRequest->MdlAddress, Context->TransferBufferMDL, Context->TransferData, Context->TransferDataLength);
+                    }
                 }
 
-                //
-                // I/O paging request
-                //
-                Context->TransferBufferMDL = OriginalRequest->MdlAddress;
+                if (!Context->TransferBufferMDL)
+                {
+                    //
+                    // I/O paging request
+                    //
+                    Context->TransferBufferMDL = OriginalRequest->MdlAddress;
+                }
             }
             else
             {




More information about the Ros-diffs mailing list