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=BNgwxWPB; spf=pass (domain: gmx.de, ip: 212.227.15.19, mailfrom: xypron.glpk@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by groups.io with SMTP; Tue, 10 Sep 2019 01:12:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1568103147; bh=Mqy/9MEAXpS1f/ead6X6eMCb2VNDVHIFXkfMFKcfEvQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=BNgwxWPB5+3mfGKTDPH7d3MyeSaLiVU8jfG/9djBpijSEjNGxOtyHQkSV7B2ncVu1 GDBlVe79v3EGK+xmv2mQuncQm2i6KqNUa0L4yyLBnkS+c2kLEQN/RdVy58wM+ARpd3 lflIPwZUJ31RftdMGWNccChecbM0mCifXbkxiNr0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([84.118.159.3]) by mail.gmx.com (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MQiVh-1hhzM61m2v-00U0LY; Tue, 10 Sep 2019 10:12:27 +0200 From: "Heinrich Schuchardt" To: EDK II Development , Dandan Bi Cc: Hao A Wu , Jian J Wang , Liming Gao , Star Zeng , Jiewen Yao , Laszlo Ersek , Eric Jin , Supreeth Venkatesh , Stephano Cetola , Heinrich Schuchardt Subject: [edk2-core] [PATCH v2 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec Date: Tue, 10 Sep 2019 10:12:19 +0200 Message-Id: <20190910081219.3680-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:UHSK4pGJ/IMXb21WvtYg9746BVF8RJVmGjj/h1loZKTDPUYb+NK JAOI9nwngcXLYalKT+ytZBmILlwIons+5zVFWAfYl4pnu7n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rK6cA9MzDiPv0pQ+gitE8Ls/v6arkozg8k4KmG5cKKhal3r7q2q7 /n6+t/N6nmOqsQeXF/unFqulYY87wNokM4oTwMkLmGBoQsqBOqgEwRQQI+1yTlph2VgB/Cgkq 37zU4KQfka6o8B62KGLLHzikDyEs2o4ja50DO//KZ6qGVSSeZS5dCzzci7X+VJZWV9jlW9U2V sqYcqaRpa48DgvZstg7UzkxZvHQVoX52Jj8WOGViOEq7svFNu3B2HaLprIYzioJLgWslArmUe 22D8M6ZubI0CsXHSrLmtcRYX/5QeM2w3cwM5Ga6sgMtLHx+1FKaOpEvPcyB2gqg40QibglwMj ivFwZUNeEXqnjEUkJ 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 --- 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 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Ha= nd/Handle.c index b2721b3ab2..719ba98261 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c @@ -802,20 +802,28 @@ 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 in reverse order of uninstalling and EFI_INVALID_PARAMETE= R is=0D + 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 + @return EFI_SUCCESS if all protocol interfaces where uninstal= led.=0D + @return 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 +872,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