mirror_edk2/MdeModulePkg/Bus
Ruiyu Ni b659b503fa MdeModulePkg/UsbBus: Fix system hang when failed to uninstall UsbIo
When "reconnect -r" is typed in shell, UsbFreeInterface() is called
to uninstall the UsbIo and DevicePath. But When a UsbIo is opened
by a driver and that driver rejects to close the UsbIo in Stop(),
the uninstall doesn't succeed.
But UsbFreeInterface () frees the DevicePath memory without check
whether the uninstall succeeds.
It leads to the DXE core database contain a DevicePath instance but
that instance's memory is freed.
Assertion happens when someone calls InstallProtocol(DevicePath)
because the InstallProtocol() checks all DevicePath instance to
find whether the same one exits in database.

We haven't seen any USB device driver which rejects to close UsbIo
in Stop(), but it's very likely.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
2017-06-02 12:59:27 +08:00
..
Ata MdeModulePkg/AtaAtapiPassThru: Ensure GHC.AE bit is always set in Ahci 2016-11-24 15:54:55 +00:00
I2c/I2cDxe MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
Isa MdeModulePkg Ps2KbDxe: Execute key notify func at TPL_CALLBACK 2016-12-26 18:17:00 +08:00
Pci MdeModulePkg/Xhci: Fill the 'interval' field for ISO endpoint context 2017-06-01 08:54:03 +08:00
Scsi MdeModulePkg/ScsiDiskDxe: Fix undefined behavior in signed left shift 2017-04-13 08:58:45 +08:00
Sd MdeModulePkg/SdMmc: Add break to avoid dead loop when polling OCR Reg 2017-03-13 21:41:46 +08:00
Ufs MdeModulePkg/UfsPassThruDxe: Fix typo in UfsPassThruGetTargetLun() 2017-05-17 15:26:24 +08:00
Usb MdeModulePkg/UsbBus: Fix system hang when failed to uninstall UsbIo 2017-06-02 12:59:27 +08:00