Skip to content

Commit

Permalink
Fix memory leak per microsoft#632, remove Mu comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-j-zimmer committed Dec 20, 2024
1 parent cdea7f5 commit 5808a09
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Platforms/QemuQ35Pkg/ConfigKnobs/ConfigDataGfx/ConfigDataGfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ ApplyGfxConfigToPolicy (

if (GfxSiliconPolicy == NULL) {
DEBUG ((DEBUG_ERROR, "Failed to allocate Policy structure\n"));
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
} // Mu
}

// We only translate the GFX ports #0 exposed to platform from conf data
GfxSiliconPolicy[0].Power_State_Port = GfxEnablePort0;
Expand All @@ -76,11 +77,13 @@ ApplyGfxConfigToPolicy (

if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a Failed to update GFX policy per configuration data - %r!!!\n", __func__, Status));
ASSERT (FALSE);
FreePool (GfxSiliconPolicy); //Mu
goto Exit;
ASSERT_EFI_ERROR (Status);
}
FreePool (GfxSiliconPolicy); //Mu

Exit:
if (GfxSiliconPolicy != NULL) {
FreePool (GfxSiliconPolicy);
}

return Status;
}

0 comments on commit 5808a09

Please sign in to comment.