Seems that returning maximum uintn in case of bad block was a mistake,
so return just bad block type

Cc: Marvin Häuser <[email protected]>
Cc: Pedro Falcato <[email protected]>
Cc: Vitaly Cheptsov <[email protected]>
Signed-off-by: Savva Mitrofanov <[email protected]>
---
 Features/Ext4Pkg/Ext4Dxe/BlockMap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c 
b/Features/Ext4Pkg/Ext4Dxe/BlockMap.c
index 3d9e16035bee..2bc629fe9d38 100644
--- a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c
+++ b/Features/Ext4Pkg/Ext4Dxe/BlockMap.c
@@ -123,7 +123,7 @@ Ext4GetBlockPath (
       break;

     default:

       // EXT4_TYPE_BAD_BLOCK

-      return -1;

+      break;

   }

 

   return Type + 1;

@@ -230,7 +230,7 @@ Ext4GetBlocks (
 

   BlockPathLength = Ext4GetBlockPath (Partition, LogicalBlock, BlockPath);

 

-  if (BlockPathLength == (UINTN)-1) {

+  if (BlockPathLength - 1 == EXT4_TYPE_BAD_BLOCK) {

     // Bad logical block (out of range)

     return EFI_NO_MAPPING;

   }

-- 
2.37.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91655): https://edk2.groups.io/g/devel/message/91655
Mute This Topic: https://groups.io/mt/92531471/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to