Change BlockIo drivers to return EFI_NO_MEDIA or EFI_MEDIA_CHANGED even the Buffer/BufferSize/Lba is invalid so that caller can probe the media status easier.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11584 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -842,6 +842,11 @@ BlockIoReadWrite (
|
||||
//
|
||||
// Check parameters.
|
||||
//
|
||||
Media = This->Media;
|
||||
if (MediaId != Media->MediaId) {
|
||||
return EFI_MEDIA_CHANGED;
|
||||
}
|
||||
|
||||
if (Buffer == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@ -850,11 +855,6 @@ BlockIoReadWrite (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
Media = This->Media;
|
||||
if (MediaId != Media->MediaId) {
|
||||
return EFI_MEDIA_CHANGED;
|
||||
}
|
||||
|
||||
BlockSize = Media->BlockSize;
|
||||
if ((BufferSize % BlockSize) != 0) {
|
||||
return EFI_BAD_BUFFER_SIZE;
|
||||
|
Reference in New Issue
Block a user