public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nickle Wang" <nicklew@nvidia.com>
To: <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>,
	Igor Kulchytskyy <igork@ami.com>,
	"Nick Ramirez" <nramirez@nvidia.com>
Subject: [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe
Date: Wed, 5 Jul 2023 14:56:28 +0800	[thread overview]
Message-ID: <20230705065628.1329-1-nicklew@nvidia.com> (raw)

RedfishRestExDxe driver failed to uninstall service binding protocol
when driver binding stop is called. Application drivers may still
use RedfishRestExDxe after it is disconnected in system.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
---
 RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
index ad65ae213ae0..7036aed42683 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
@@ -3,6 +3,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -57,6 +58,7 @@ RestExDestroyChildEntryInHandleBuffer (
   ChildHandleBuffer = ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT *)Context)->ChildHandleBuffer;
 
   if (!NetIsInHandleBuffer (Instance->ChildHandle, NumberOfChildren, ChildHandleBuffer)) {
+    RemoveEntryList (&Instance->Link);
     return EFI_SUCCESS;
   }
 
@@ -563,7 +565,7 @@ RedfishRestExDriverBindingStop (
                                   );
   }
 
-  if ((NumberOfChildren == 0) && IsListEmpty (&RestExSb->RestExChildrenList)) {
+  if (IsListEmpty (&RestExSb->RestExChildrenList)) {
     gBS->UninstallProtocolInterface (
            NicHandle,
            &gEfiRestExServiceBindingProtocolGuid,
-- 
2.17.1


             reply	other threads:[~2023-07-05  6:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05  6:56 Nickle Wang [this message]
2023-07-05  8:42 ` [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe Mike Maslenkin
2023-07-06  8:07   ` Nickle Wang
2023-07-06 11:00     ` Chang, Abner
2023-07-06 12:11       ` Nickle Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230705065628.1329-1-nicklew@nvidia.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox