From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 06220740032 for ; Sat, 6 Apr 2024 15:53:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ZlbklI+LhFzF5P3Qasi9O2oEAhEOHj1yGnKIZhidLvE=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1712418800; v=1; b=4w9RDdpE4qCl3EsFArxffTMgy+7nmPwMamW00toirQjQaPIxMeXxNZpAzhyVMJc9Y/L8qiy2 mAsmM8vq9uq8ZmIsrFBhFx84of7vAgZjCvtsZX2psJRo+/qqJizuujToM5JYomuNvNwQStvngjH goEymyKCaHEdYDhn9XuOHXk9scJw2AQFl6l9FYaXfwzugRfudd+LB27/aOk9dLenML6Wh9+3ATe OwTO6u93a+H+SjYLnUscqZTCheMU+N1pGWVUMSVvqQvw8464/fR1ekzBR6d3zRBN8qFBwmOZUCA +mwebVLLfCeWrIoMI+oiv9eOJSchKtQrc6sgQWFNROtrQ== X-Received: by 127.0.0.2 with SMTP id KOjqYY7687511xiI0CG3rkeE; Sat, 06 Apr 2024 08:53:20 -0700 X-Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.web11.32322.1712418799613988486 for ; Sat, 06 Apr 2024 08:53:19 -0700 X-Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-343cfa6faf0so1991038f8f.0 for ; Sat, 06 Apr 2024 08:53:19 -0700 (PDT) X-Gm-Message-State: MaJjxrbDD17IzIczahfQLE47x7686176AA= X-Google-Smtp-Source: AGHT+IFvEhYqGhNbUQxOKUGQ7zmteVuiJNY62/9KXtwFG1iTsQjpXaJeZcJzhZqOZA2bOdZSqFX54Q== X-Received: by 2002:adf:f84e:0:b0:33e:bfd0:335c with SMTP id d14-20020adff84e000000b0033ebfd0335cmr3987396wrq.51.1712418797196; Sat, 06 Apr 2024 08:53:17 -0700 (PDT) X-Received: from michaels-air.lan ([185.190.95.91]) by smtp.gmail.com with ESMTPSA id g11-20020a05600c310b00b00416244a53b8sm7072457wmo.4.2024.04.06.08.53.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 06 Apr 2024 08:53:16 -0700 (PDT) From: "Mike Beaton" To: devel@edk2.groups.io Cc: Mike Beaton , Maciej Rabeda , Jiaxin Wu , Siyuan Fu Subject: [edk2-devel] [PATCH] NetworkPkg/HttpBootDxe: Correctly uninstall HttpBootCallbackProtocol Date: Sat, 6 Apr 2024 16:53:12 +0100 Message-ID: <20240406155312.26851-1-mjsbeaton@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sat, 06 Apr 2024 08:53:19 -0700 Resent-From: mjsbeaton@gmail.com Reply-To: devel@edk2.groups.io,mjsbeaton@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=4w9RDdpE; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The existing uninstall call was passing the wrong handle (parent object, not the correct child object) and additionally passing the address of a pointer to the interface to be removed rather than the pointer itself, so always failed with EFI_NOT_FOUND. After altering these, we add an ASSERT which confirms that the modified uninstall is succeeding. Cc: Maciej Rabeda Cc: Jiaxin Wu Cc: Siyuan Fu Signed-off-by: Mike Beaton --- NetworkPkg/HttpBootDxe/HttpBootImpl.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c b/NetworkPkg/HttpBootDxe= /HttpBootImpl.c index b4c61925b9..100b721ad4 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c @@ -77,12 +77,23 @@ HttpBootUninstallCallback ( IN HTTP_BOOT_PRIVATE_DATA *Private=0D )=0D {=0D + EFI_STATUS Status;=0D + EFI_HANDLE ControllerHandle;=0D +=0D if (Private->HttpBootCallback =3D=3D &Private->LoadFileCallback) {=0D - gBS->UninstallProtocolInterface (=0D - Private->Controller,=0D - &gEfiHttpBootCallbackProtocolGuid,=0D - &Private->HttpBootCallback=0D - );=0D + if (!Private->UsingIpv6) {=0D + ControllerHandle =3D Private->Ip4Nic->Controller;=0D + } else {=0D + ControllerHandle =3D Private->Ip6Nic->Controller;=0D + }=0D +=0D + Status =3D gBS->UninstallProtocolInterface (=0D + ControllerHandle,=0D + &gEfiHttpBootCallbackProtocolGuid,=0D + Private->HttpBootCallback=0D + );=0D + ASSERT_EFI_ERROR (Status);=0D +=0D Private->HttpBootCallback =3D NULL;=0D }=0D }=0D --=20 2.44.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117468): https://edk2.groups.io/g/devel/message/117468 Mute This Topic: https://groups.io/mt/105368366/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-