summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c7
-rw-r--r--MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
index fc0007dd11..95ad8701af 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
@@ -120,7 +120,12 @@ UsbCreateInterface (
UsbIf->Device = Device;
UsbIf->IfDesc = IfDesc;
UsbIf->IfSetting = IfDesc->Settings[IfDesc->ActiveIndex];
- UsbIf->UsbIo = mUsbIoProtocol;
+
+ CopyMem (
+ &(UsbIf->UsbIo),
+ &mUsbIoProtocol,
+ sizeof (EFI_USB_IO_PROTOCOL)
+ );
//
// Install protocols for USBIO and device path
diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
index 980f8b2895..80fdf47055 100644
--- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
+++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
@@ -626,7 +626,12 @@ UsbBootDetectMedia (
EFI_STATUS Status;
Media = &UsbMass->BlockIoMedia;
- OldMedia = UsbMass->BlockIoMedia;
+
+ CopyMem (
+ &OldMedia,
+ &(UsbMass->BlockIoMedia),
+ sizeof (EFI_BLOCK_IO_MEDIA)
+ );
//
// First test whether the device is ready and get status