usb: Don't access uninit pointer if usbh_install fails

This commit is contained in:
Tomas Rezucha 2022-11-29 13:30:36 +01:00 committed by BOT
parent 0dd6826a05
commit a0dacf826f

View File

@ -438,8 +438,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: