]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Change BlockIo drivers to return EFI_NO_MEDIA or EFI_MEDIA_CHANGED even the Buffer...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 25 Apr 2011 09:32:25 +0000 (09:32 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 25 Apr 2011 09:32:25 +0000 (09:32 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11585 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyBlock.c

index 4076f5396515d755245c9b3eb1f6f5709900707e..39f0ba0191cc6695f5818724b99921f211bc36c0 100644 (file)
@@ -225,16 +225,7 @@ FddReadWriteBlocks (
       FdcFreeCache (FdcDev);\r
     }\r
   }\r
-  //\r
-  // Check the Parameter is valid\r
-  //\r
-  if (Buffer == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
 \r
-  if (BufferSize == 0) {\r
-    return EFI_SUCCESS;\r
-  }\r
   //\r
   // Set the drive motor on\r
   //\r
@@ -268,6 +259,11 @@ FddReadWriteBlocks (
     return EFI_MEDIA_CHANGED;\r
   }\r
 \r
+  if (BufferSize == 0) {\r
+    MotorOff (FdcDev);\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
   if (Operation == WRITE) {\r
     if (Media->ReadOnly) {\r
       MotorOff (FdcDev);\r
@@ -277,6 +273,11 @@ FddReadWriteBlocks (
   //\r
   // Check the parameters for this read/write operation\r
   //\r
+  if (Buffer == NULL) {\r
+    MotorOff (FdcDev);\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   if (BufferSize % BlockSize != 0) {\r
     MotorOff (FdcDev);\r
     return EFI_BAD_BUFFER_SIZE;\r