diff --git a/Library/OcBootManagementLib/DefaultEntryChoice.c b/Library/OcBootManagementLib/DefaultEntryChoice.c index 61ba07ee..db0e8da7 100644 --- a/Library/OcBootManagementLib/DefaultEntryChoice.c +++ b/Library/OcBootManagementLib/DefaultEntryChoice.c @@ -664,6 +664,7 @@ InternalGetDefaultBootEntry ( &DeviceHandle ); if (EFI_ERROR (Status)) { + BootEntry = NULL; continue; } diff --git a/Library/OcDeviceTreeLib/OcDeviceTreeLib.c b/Library/OcDeviceTreeLib/OcDeviceTreeLib.c index 4a790465..9019e916 100755 --- a/Library/OcDeviceTreeLib/OcDeviceTreeLib.c +++ b/Library/OcDeviceTreeLib/OcDeviceTreeLib.c @@ -588,6 +588,8 @@ DTDeleteProperty ( CHAR8 *DeviceTreeEnd; UINT32 DeleteLength; + ASSERT (mDTLength != NULL); + PropIter = &mOpaquePropIter; DeletePosition = NULL; DeviceTreeEnd = (CHAR8 *) mDTRootNode + *mDTLength; @@ -603,9 +605,7 @@ DTDeleteProperty ( // // Adjust Device Tree Length. // - if (mDTLength != NULL) { - *mDTLength -= DeleteLength; - } + *mDTLength -= DeleteLength; // // Delete Property. @@ -656,6 +656,8 @@ DTInsertProperty ( CHAR8 *DeviceTreeEnd; CHAR8 *InsertPosition; + ASSERT (mDTLength != NULL); + PropIter = &mOpaquePropIter; EntryLength = ALIGN_VALUE (ValueLength, sizeof (UINT32)); DeviceTree = NULL; @@ -707,9 +709,7 @@ DTInsertProperty ( // // Adjust Length. // - if (mDTLength != NULL) { - *mDTLength += sizeof (DTProperty) + EntryLength; - } + *mDTLength += sizeof (DTProperty) + EntryLength; } } } diff --git a/Platform/OpenCore/OpenCoreUefi.c b/Platform/OpenCore/OpenCoreUefi.c index 3c081f02..a7ba62bc 100644 --- a/Platform/OpenCore/OpenCoreUefi.c +++ b/Platform/OpenCore/OpenCoreUefi.c @@ -223,7 +223,7 @@ OcLoadDrivers ( // // Driver connection list should be null-terminated. // - if (*DriversToConnectIterator != NULL) { + if (DriversToConnectIterator != NULL) { *DriversToConnectIterator = NULL; } }