Răsfoiți Sursa

usb: Don't access uninit pointer if usbh_install fails

Tomas Rezucha 3 ani în urmă
părinte
comite
a0dacf826f
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      components/usb/usb_host.c

+ 2 - 2
components/usb/usb_host.c

@@ -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: