diff options
Diffstat (limited to 'MdeModulePkg/Universal')
4 files changed, 17 insertions, 23 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index 8a46972f7d..0e8efd18d0 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -260,8 +260,9 @@ SetPassword ( //
// Retrive uncommitted data from Browser
//
- Configuration = (DRIVER_SAMPLE_CONFIGURATION *) HiiGetBrowserData (&mFormSetGuid, VariableName, sizeof (DRIVER_SAMPLE_CONFIGURATION));
- if (Configuration != NULL) {
+ Configuration = AllocateZeroPool (sizeof (DRIVER_SAMPLE_CONFIGURATION));
+ ASSERT (Configuration != NULL);
+ if (HiiGetBrowserData (&mFormSetGuid, VariableName, sizeof (DRIVER_SAMPLE_CONFIGURATION), (UINT8 *) Configuration)) {
//
// Update password's clear text in the screen
//
@@ -277,10 +278,13 @@ SetPassword ( (UINT8 *) Configuration,
NULL
);
-
- FreePool (Configuration);
}
+ //
+ // Free Configuration Buffer
+ //
+ FreePool (Configuration);
+
//
// Set password
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf index 657d0ca78e..ff8b49a51d 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf @@ -61,7 +61,7 @@ [Protocols]
gEfiHiiStringProtocolGuid ## CONSUMES
gEfiHiiConfigRoutingProtocolGuid ## CONSUMES
- gEfiHiiConfigAccessProtocolGuid ## CONSUMES
+ gEfiHiiConfigAccessProtocolGuid ## PRODUCES
gEfiFormBrowser2ProtocolGuid ## CONSUMES
gEfiHiiDatabaseProtocolGuid ## CONSUMES
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c index 0025f24bc1..62fd606aff 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c @@ -505,8 +505,10 @@ IScsiFormCallback ( //
// Retrive uncommitted data from Browser
//
- IfrNvData = (ISCSI_CONFIG_IFR_NVDATA *) HiiGetBrowserData (&mVendorGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA));
- if (IfrNvData == NULL) {
+ IfrNvData = AllocateZeroPool (sizeof (ISCSI_CONFIG_IFR_NVDATA));
+ ASSERT (IfrNvData != NULL);
+ if (!HiiGetBrowserData (&mVendorGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData)) {
+ FreePool (IfrNvData);
return EFI_NOT_FOUND;
}
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c index 47921cd43b..2c1d9d96c5 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c @@ -1211,8 +1211,8 @@ PlatOverMngrRouteConfig ( PLAT_OVER_MNGR_DATA *FakeNvData;
Private = EFI_CALLBACK_INFO_FROM_THIS (This);
- FakeNvData = (PLAT_OVER_MNGR_DATA *) HiiGetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA));
- if (FakeNvData == NULL) {
+ FakeNvData = &Private->FakeNvData;
+ if (HiiGetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData)) {
return EFI_NOT_FOUND;
}
@@ -1233,10 +1233,6 @@ PlatOverMngrRouteConfig ( CommintChanges (Private, KeyValue, FakeNvData);
}
- if (FakeNvData != NULL) {
- FreePool (FakeNvData);
- }
-
return EFI_SUCCESS;
}
@@ -1279,8 +1275,8 @@ PlatOverMngrCallback ( PLAT_OVER_MNGR_DATA *FakeNvData;
Private = EFI_CALLBACK_INFO_FROM_THIS (This);
- FakeNvData = (PLAT_OVER_MNGR_DATA *) HiiGetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA));
- if (FakeNvData == NULL) {
+ FakeNvData = &Private->FakeNvData;
+ if (HiiGetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData)) {
return EFI_NOT_FOUND;
}
@@ -1344,14 +1340,6 @@ PlatOverMngrCallback ( // Pass changed uncommitted data back to Form Browser
//
HiiSetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData, NULL);
-
- //
- // Update local configuration buffer.
- //
- CopyMem (&Private->FakeNvData, FakeNvData, sizeof (PLAT_OVER_MNGR_DATA));
- if (FakeNvData != NULL) {
- FreePool (FakeNvData);
- }
return EFI_SUCCESS;
}
|