mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:05:43 +00:00
[USBSTOR]
- Fix bug in usbstor, which did not take the offset into account svn path=/branches/usb-bringup-trunk/; revision=55088
This commit is contained in:
parent
9758b6cc87
commit
8baf90438a
1 changed files with 20 additions and 2 deletions
|
@ -576,7 +576,7 @@ USBSTOR_SendRequest(
|
|||
if (Context->TransferDataLength)
|
||||
{
|
||||
//
|
||||
// check if the original request already does not have an mdl associated
|
||||
// check if the original request already does have an mdl associated
|
||||
//
|
||||
if (OriginalRequest)
|
||||
{
|
||||
|
@ -589,7 +589,25 @@ USBSTOR_SendRequest(
|
|||
if (CommandLength == UFI_READ_WRITE_CMD_LEN)
|
||||
{
|
||||
MdlVirtualAddress = MmGetMdlVirtualAddress(OriginalRequest->MdlAddress);
|
||||
ASSERT(MdlVirtualAddress == Context->TransferData);
|
||||
if (MdlVirtualAddress != Context->TransferData)
|
||||
{
|
||||
//
|
||||
// lets build an mdl
|
||||
//
|
||||
Context->TransferBufferMDL = IoAllocateMdl(Context->TransferData, MmGetMdlByteCount(OriginalRequest->MdlAddress), FALSE, FALSE, NULL);
|
||||
if (!Context->TransferBufferMDL)
|
||||
{
|
||||
//
|
||||
// failed to allocate MDL
|
||||
//
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// now build the partial mdl
|
||||
//
|
||||
IoBuildPartialMdl(OriginalRequest->MdlAddress, Context->TransferBufferMDL, Context->TransferData, Context->TransferDataLength);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue