sys_usbd: Fix null pointer deref on destruction

This commit is contained in:
Attila Fidan 2025-03-12 19:53:36 +00:00
parent ff40128df6
commit 1a17811a65
No known key found for this signature in database
GPG key ID: 6D8AFE438CCD44F6

View file

@ -591,7 +591,8 @@ usb_handler_thread::~usb_handler_thread()
}
#if LIBUSB_API_VERSION >= 0x01000102
libusb_hotplug_deregister_callback(ctx, callback_handle);
if (ctx && hotplug_supported)
libusb_hotplug_deregister_callback(ctx, callback_handle);
#endif
if (ctx)