提交 5126895c 编写于 作者: D Download-Fritz

OcDevicePathLib: Correct DP fix return code

上级 a9d58f82
......@@ -436,6 +436,7 @@ OcFixAppleBootDevicePath (
)
{
INTN Result;
INTN NodePatched;
EFI_DEVICE_PATH_PROTOCOL *OriginalDevPath;
EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath;
......@@ -455,7 +456,7 @@ OcFixAppleBootDevicePath (
// to the loop for an explanation.
//
RestoreContextPtr = &FirstNodeRestoreContext;
NodePatched = 0;
do {
//
// Retrieve the first Device Path node that cannot be located.
......@@ -481,8 +482,9 @@ OcFixAppleBootDevicePath (
//
RestoreContextPtr = NULL;
//
// Continue as long as nodes are being patched.
// Continue as long as nodes are being patched. Remember patch status.
//
NodePatched |= Result > 0;
} while (Result > 0);
*DevicePath = RemainingDevicePath;
......@@ -495,7 +497,7 @@ OcFixAppleBootDevicePath (
// be of a prefix short-form and hence restoring is not beneficial (and most
// especially would require tracking every node individually).
//
if (RemainingDevicePath == OriginalDevPath) {
if (NodePatched != 0 && RemainingDevicePath == OriginalDevPath) {
OcFixAppleBootDevicePathNodeRestore (
OriginalDevPath,
&FirstNodeRestoreContext
......@@ -505,7 +507,7 @@ OcFixAppleBootDevicePath (
return -1;
}
return RemainingDevicePath == OriginalDevPath ? 0 : 1;
return NodePatched;
}
STATIC
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册