Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/pg2-util/dfu_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ bool dfu_load(const firmware_image_t *image, libusb_device *dev, libusb_device *
/* wait for the new device to appear */
post_hotplug = hotplug_await(hotplug_state);
if (loaded_device)
*loaded_device = libusb_ref_device(post_hotplug);
*loaded_device = post_hotplug ? libusb_ref_device(post_hotplug) : NULL;

cleanup:
if (handle)
Expand Down
2 changes: 1 addition & 1 deletion cli/pg2-util/mem_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool mem_load(const firmware_image_t *image, libusb_device *dev, libusb_device *
/* wait for the new device to appear */
post_hotplug = hotplug_await(hotplug_state);
if (loaded_device)
*loaded_device = libusb_ref_device(post_hotplug);
*loaded_device = post_hotplug ? libusb_ref_device(post_hotplug) : NULL;

cleanup:
if (handle)
Expand Down
Loading