Skip to content

Commit

Permalink
usb: Don't access uninit pointer if usbh_install fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tore-espressif committed Dec 1, 2022
1 parent 2dc3664 commit 823c8d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/usb/usb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ esp_err_t usb_host_install(const usb_host_config_t *config)
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:
Expand Down

0 comments on commit 823c8d4

Please sign in to comment.