]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enhance drivers for sanity check and coding style alignment.
authorgdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 1 Nov 2011 09:18:30 +0000 (09:18 +0000)
committergdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 1 Nov 2011 09:18:30 +0000 (09:18 +0000)
Signed-off-by: gdong1
Reviewed-by: ydong10
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12622 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c
SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyIdentityPolicy.c
SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h

index 613751e0232a759bb0e5020849f36d78fa6f1be1..d73f77eeec970fa87adb7dde444209b3ed4c6b92 100644 (file)
@@ -167,7 +167,7 @@ SaveAccessPolicy (
   //\r
   // Save access policy.\r
   //\r
-  if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0)) {\r
+  if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0) && (mUserInfo.AccessPolicy != NULL)) {\r
     Info = AllocateZeroPool (sizeof (EFI_USER_INFO) + mUserInfo.AccessPolicyLen);\r
     if (Info == NULL) {\r
       return ;\r
index 2e2d67edfc82903d3dadd237088277ff51b64188..eaf53c9678de527b8238d774146525abeeeab847 100644 (file)
@@ -58,7 +58,7 @@ ProviderAlreadyInPolicy (
 \r
 \r
 /**\r
-  Add or delete the user's credential record in the provider.\r
+  Add the user's credential record in the provider.\r
 \r
   @param[in]  ProviderGuid        Point to credential provider guid.\r
   @param[in]  User                Points to user profile.\r
@@ -157,17 +157,13 @@ DeleteCredentialFromProviders (
 \r
 \r
 /**\r
-  Remove the provider in FindIdentity from the user identification information record.\r
+  Remove the provider specified by Offset from the new user identification record.\r
   \r
-  @param[in, out] NewInfo       On entry, points to the user information to remove provider. \r
-                                On return, points to the user information the provider is removed.\r
-  @param[in]      FindIdentity  Point to the user identity policy.\r
-\r
-  @retval TRUE                  The provider is removed successfully.\r
-  @retval FALSE                 Fail to remove the provider.\r
+  @param[in]  IdentityPolicy    Point to user identity item in new identification policy.\r
+  @param[in]  Offset            The item offset in the new identification policy.\r
 \r
 **/\r
-BOOLEAN\r
+VOID\r
 DeleteProviderFromPolicy (\r
   IN     EFI_USER_INFO_IDENTITY_POLICY         *IdentityPolicy,\r
   IN     UINTN                                 Offset\r
@@ -184,7 +180,7 @@ DeleteProviderFromPolicy (
     IdentityPolicy->Type           = EFI_USER_INFO_IDENTITY_TRUE;\r
     IdentityPolicy->Length         = sizeof (EFI_USER_INFO_IDENTITY_POLICY);\r
     mUserInfo.NewIdentityPolicyLen = IdentityPolicy->Length;\r
-    return TRUE;\r
+    return ;\r
   }\r
 \r
   DeleteLen = IdentityPolicy->Length + sizeof(EFI_USER_INFO_IDENTITY_POLICY);\r
@@ -196,17 +192,19 @@ DeleteProviderFromPolicy (
     CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen);\r
   }\r
   mUserInfo.NewIdentityPolicyLen -= DeleteLen;  \r
\r
-  return FALSE;\r
 }\r
 \r
 \r
 /**\r
-  Update the mUserInfo.NewIdentityPolicy, and UI when 'add option' is pressed.\r
+  Add a new provider to the mUserInfo.NewIdentityPolicy.\r
+\r
+  It is invoked when 'add option' in UI is pressed.\r
 \r
+  @param[in] NewGuid       Points to the credential provider guid.\r
+  \r
 **/\r
 VOID\r
- AddProviderToPolicy (\r
+AddProviderToPolicy (\r
   IN  EFI_GUID                                  *NewGuid\r
   )\r
 {\r
@@ -489,7 +487,7 @@ SaveIdentityPolicy (
 \r
 **/\r
 VOID\r
- AddIdentityPolicyItem (\r
+AddIdentityPolicyItem (\r
   VOID\r
   )\r
 {\r
index 3fe403106bc7f0ef460f53889592239fbf8f44f5..8be302e1ccb4fff3052e680e65c295a9a0869068 100644 (file)
@@ -229,6 +229,7 @@ DeleteUser (
     //\r
     // Delete the user on the credential providers by its identification policy.\r
     //\r
+    ASSERT (Info != NULL);\r
     DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User);\r
     FreePool (Info);\r
     \r
index 007b7d8737426513f6fff12aebfb62c9addf9bf6..ffc4720aea2d2f8a3c67b67c29096778be79ebdb 100644 (file)
@@ -85,7 +85,6 @@ InstallSecureBootConfigForm (
   @param[in, out]  PrivateData   Points to SecureBoot configuration private data.\r
 \r
 **/\r
-\r
 VOID\r
 UninstallSecureBootConfigForm (\r
   IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA    *PrivateData\r