From 2c89caab9bed03f8b125db0498587e9c655995ee Mon Sep 17 00:00:00 2001 From: Tomas Rezucha Date: Tue, 29 Nov 2022 13:30:36 +0100 Subject: [PATCH] usb: Don't access uninit pointer if usbh_install fails --- components/usb/usb_host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/usb/usb_host.c b/components/usb/usb_host.c index 165cd400b9..3aad9d39af 100644 --- a/components/usb/usb_host.c +++ b/components/usb/usb_host.c @@ -437,8 +437,8 @@ assign_err: hub_err: ESP_ERROR_CHECK(usbh_uninstall()); usbh_err: - if (p_host_lib_obj->constant.phy_handle) { - ESP_ERROR_CHECK(usb_del_phy(p_host_lib_obj->constant.phy_handle)); + if (host_lib_obj->constant.phy_handle) { + ESP_ERROR_CHECK(usb_del_phy(host_lib_obj->constant.phy_handle)); } phy_err: alloc_err: