Skip to content

usb: clean up RX transfers when resubmission fails - #289

Open
ooonea wants to merge 1 commit into
libimobiledevice:masterfrom
ooonea:fix-rx-resubmit-cleanup
Open

ooonea wants to merge 1 commit into
libimobiledevice:masterfrom
ooonea:fix-rx-resubmit-cleanup

Conversation

@ooonea

@ooonea ooonea commented Oct 6, 2026

Copy link
Copy Markdown

A failed RX resubmission leaves an inactive transfer in rx_xfers. Cancelling it cannot produce a callback, so usb_disconnect() waits indefinitely. Check the return value in rx_callback() and use the existing cleanup path on failure.

Captured on Linux with libusb 1.0.29: the daemon stopped answering ListDevices after the first phone connection. Its stack was in the disconnect loop; all three retained RX transfers were inactive, with no TX transfers remaining. The original resubmission error was not captured, and the patch has not yet been tested on the device.

Validation: full Linux build; source-extracted callback tests covering all transfer statuses and successful/failed resubmission; teardown regression reproducing the wait before the change and completing after it.

A failed resubmission leaves an inactive transfer in rx_xfers. Cancelling it cannot produce a callback, so usb_disconnect waits indefinitely. Route resubmission failures through the existing cleanup path.

Assisted-by: OpenAI Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant