edk2/MdeModulePkg/Universal/Disk
Hao Wu 49680c684f MdeModulePkg PartitionDxe: Add Re-entry handling logic for BindingStop
There are scenario when the BindingStop service of PartitionDxe driver be
re-entered.

An example will be ejecting a DVD from a SATA DVDROM and then run
"reconnect -r" under shell. In this specific case, part of the calling
stack will be:

PartitionDriverBindingStop() (PartitionDxe) ->
Stop first child handle (PartitionDxe) ->
ScsiDiskFlushBlocksEx() (ScsiDiskDxe) ->
A media change is detected (ScsiDiskDxe) ->
Reinstall of BlockIO(2) protocols (ScsiDiskDxe) ->
Entering PartitionDriverBindingStop() again (PartitionDxe) ->
Potential risk of referencing already stopped child handle (PartitionDxe)
...

The current code has potential issue of referencing of already stopped
child handle. This commit adds re-entry handling logic to resolve such
issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
(cherry picked from commit e33257215b)
2016-08-02 15:09:48 +08:00
..
CdExpressPei MdeModulePkg/CdExpressPei: Fix build error 2015-05-21 05:36:40 +00:00
DiskIoDxe MdeModulePkg DiskIoDxe: Check for MediaPresent in DiskIo2ReadWriteDisk() 2015-12-23 01:35:24 +00:00
PartitionDxe MdeModulePkg PartitionDxe: Add Re-entry handling logic for BindingStop 2016-08-02 15:09:48 +08:00
UnicodeCollation/EnglishDxe MdeModulePkg: Convert non DOS format files to DOS format and remove unused module UNI files. 2014-09-03 08:39:12 +00:00