public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/2] MdeModulePkg/UsbBusDxe: Avoid continuing on error path
@ 2022-09-20 13:14 Sean Rhodes
  2022-09-20 13:14 ` [PATCH 2/2] MdeModulePkg/UsbBusDxe: Reset the device on error Sean Rhodes
  2022-09-21  5:30 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/UsbBusDxe: Avoid continuing on error path Wu, Hao A
  0 siblings, 2 replies; 10+ messages in thread
From: Sean Rhodes @ 2022-09-20 13:14 UTC (permalink / raw)
  To: devel; +Cc: Sean Rhodes, Hao A Wu, Ray Ni

Zero out the PortState in case GetPortStatus didn't set it, to avoid
continuing with EFI_DEVICE_ERROR.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
index aed34596f4..7fc567898a 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
@@ -900,6 +900,11 @@ UsbEnumeratePort (
   Child  = NULL;
   HubApi = HubIf->HubApi;
 
+  // Zero out PortState in case GetPortStatus does not set it and we
+  // continue on the EFI_DEVICE_ERROR path
+  PortState.PortStatus       = 0;
+  PortState.PortChangeStatus = 0;
+
   //
   // Host learns of the new device by polling the hub for port changes.
   //
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-09-23  8:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-20 13:14 [PATCH 1/2] MdeModulePkg/UsbBusDxe: Avoid continuing on error path Sean Rhodes
2022-09-20 13:14 ` [PATCH 2/2] MdeModulePkg/UsbBusDxe: Reset the device on error Sean Rhodes
2022-09-21  5:31   ` [edk2-devel] " Wu, Hao A
2022-09-21  5:30 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/UsbBusDxe: Avoid continuing on error path Wu, Hao A
2022-09-21  8:00   ` Sean Rhodes
2022-09-21  8:24     ` Wu, Hao A
2022-09-21  8:36       ` Sean Rhodes
2022-09-22  7:30         ` Wu, Hao A
2022-09-23  8:02           ` Sean Rhodes
2022-09-23  8:12             ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox