MdeModulePkg DiskIoDxe: Check for MediaPresent in DiskIo2ReadWriteDisk()

Add check to see if there is a media in the disk device. If not return
EFI_NO_MEDIA directly.

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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19446 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Hao Wu 2015-12-22 13:55:13 +00:00 committed by hwu1225
parent 40b0f96fd2
commit 66ca22d05c
1 changed files with 4 additions and 0 deletions

View File

@ -833,6 +833,10 @@ DiskIo2ReadWriteDisk (
Status = EFI_SUCCESS;
Blocking = (BOOLEAN) ((Token == NULL) || (Token->Event == NULL));
if (!(Media->MediaPresent)) {
return EFI_NO_MEDIA;
}
if (Media->MediaId != MediaId) {
return EFI_MEDIA_CHANGED;
}