mirror of https://github.com/acidanthera/audk.git
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:
parent
40b0f96fd2
commit
66ca22d05c
|
@ -833,6 +833,10 @@ DiskIo2ReadWriteDisk (
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
Blocking = (BOOLEAN) ((Token == NULL) || (Token->Event == NULL));
|
Blocking = (BOOLEAN) ((Token == NULL) || (Token->Event == NULL));
|
||||||
|
|
||||||
|
if (!(Media->MediaPresent)) {
|
||||||
|
return EFI_NO_MEDIA;
|
||||||
|
}
|
||||||
|
|
||||||
if (Media->MediaId != MediaId) {
|
if (Media->MediaId != MediaId) {
|
||||||
return EFI_MEDIA_CHANGED;
|
return EFI_MEDIA_CHANGED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue