]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkUnixPkg/Dxe/UnixThunk/Bus/Uga/ComponentName.c
Fix component name bugs when input Controller Name is invalid
[mirror_edk2.git] / EdkUnixPkg / Dxe / UnixThunk / Bus / Uga / ComponentName.c
index e6e5ebe3a591d81ea38a8169bf2059f87b03da91..5c50d5689c034a4c3c2edac90ef93efb39d0aa69 100644 (file)
@@ -161,6 +161,17 @@ UnixUgaComponentNameGetControllerName (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
+  //\r
+  // Make sure this driver is currently managing ControllerHandle\r
+  //\r
+  Status = EfiTestManagedDevice (\r
+             ControllerHandle,\r
+             gUnixUgaDriverBinding.DriverBindingHandle,\r
+             &gEfiUnixIoProtocolGuid\r
+             );\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
   //\r
   // Get our context back\r
   //\r