From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=GJanuu3Q; spf=pass (domain: gmx.de, ip: 212.227.17.20, mailfrom: xypron.glpk@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by groups.io with SMTP; Wed, 11 Sep 2019 23:34:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1568270076; bh=SRdB1y/QhPC3wQhbes602GtVEGk5TuXjF6qnjel2YsY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=GJanuu3QiWsiPAC4DpM5ngcoIOmuPwrL87WjALmUwXmvOT2PAm2RfRZbsZxnNzth8 QMcTeN7oxtPC2k1JZELIv4bt2pm0XjiG8thmnLuy2zLciWu0/i5pBQDPtbGJAVA038 bNhOtif2PRHLN2wrHtqiFMuQGxXA7m7Z7bQroKiI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([84.118.159.3]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MysRu-1iLrDy21OE-00w1B9; Thu, 12 Sep 2019 08:34:36 +0200 From: "Heinrich Schuchardt" To: EDK II Development , Dandan Bi Cc: Eric Jin , Supreeth Venkatesh , Stephano Cetola , Hao A Wu , Jian J Wang , Liming Gao , Star Zang , Jiewen Yao , Laszlo Ersek , Heinrich Schuchardt Subject: [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec Date: Thu, 12 Sep 2019 08:34:06 +0200 Message-Id: <20190912063406.9477-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:x7m/3aVUKMLW3gXZVGR8uop+yEGh1F113NQY25LuGjyvGf3R1gL OvVHbKy74nBl0GaRYtI1d8flVUMJu83yGDXnryvxXruFVGSBvNTy1W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BeiV9oj4WuJHfbRaQb2xyhjn+1ibMxzVkbE2hg/KiAUqnj6IAon4SGRbLJq F0RVKBqzuYtsJ5tmx9FypcFwjD4AEy7glu6Lc5M7EWS5yR5Edx5IrKDaiatOqNa8zu5PxPz9C ufBFKSR3PbU2bOsej9Yq1vTu2hvhRzRdThc3EWpfUDBvyb0GfMo1vjUHWK6J+2E6GdmOyaBrW 91nTBF60uRVai5/lysAeGf6TS+kUy8X/Y16GuqJEYpZoEVXtc6HbJ7qHQ9KDipAO4NeW3Bkmn q5eIPD9lUtWhKHay7v0C6ngFsUeTMRHHeEI+wHiv6Ijfriqr2USutYIbFSCTqY3fkMQAs= Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1869 The UEFI spec requires that if any error occurs in UninstallMultipleProtocolInterfaces(), EFI_INVALID_PARAMETER is returned and not the return code of UninstallProtocolInterface(). Signed-off-by: Heinrich Schuchardt Reviewed-by: Dandan Bi --- v3 Use @retval instead of @return. The protocols are reinstalled in the same order in which they are uninstalled. v2 Adjust the subject line. Adjust the function comments to clarify the behavior. This replaces https://edk2.groups.io/g/devel/message/46974 --- MdeModulePkg/Core/Dxe/Hand/Handle.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Ha= nd/Handle.c index b2721b3ab2..81a13c6ae5 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c @@ -802,20 +802,27 @@ Done: =0D =0D =0D -=0D /**=0D Uninstalls a list of protocol interface in the boot services environment= .=0D - This function calls UnisatllProtocolInterface() in a loop. This is=0D + This function calls UninstallProtocolInterface() in a loop. This is=0D basically a lib function to save space.=0D =0D - @param Handle The handle to uninstall the protocol=0D + If any errors are generated while the protocol interfaces are being=0D + uninstalled, then the protocol interfaces uninstalled prior to the error= will=0D + be reinstalled and EFI_INVALID_PARAMETER will be returned.=0D +=0D + @param Handle The handle to uninstall the protocol inte= rfaces=0D + from.=0D @param ... EFI_GUID followed by protocol instance. A= NULL=0D - terminates the list. The pairs are the=0D + terminates the list. The pairs are the=0D arguments to UninstallProtocolInterface()= . All=0D the protocols are added to Handle.=0D =0D - @return Status code=0D -=0D + @retval EFI_SUCCESS if all protocol interfaces where uninstal= led.=0D + @retval EFI_INVALID_PARAMETER if any protocol interface could not be=0D + uninstalled and an attempt was made to=0D + reinstall previously uninstalled protocol= =0D + interfaces.=0D **/=0D EFI_STATUS=0D EFIAPI=0D @@ -864,6 +871,7 @@ CoreUninstallMultipleProtocolInterfaces ( CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFAC= E, Interface);=0D }=0D VA_END (Args);=0D + Status =3D EFI_INVALID_PARAMETER;=0D }=0D =0D return Status;=0D --=20 2.20.1