Critical fixes:
- Add error_free_urbs cleanup path in tascam_alloc_urbs() to prevent memory leaks on partial URB allocation failure
- Fix tascam_create_midi() with individual cleanup for each failed allocation step
High fixes:
- Check usb_set_interface() return values in probe and resume, log errors with dev_warn()
- Validate handshake_result after retry loop exhaustion; return -EIO if all retries fail
- Stop capture_substream in tascam_stop_pcm_work_handler() to prevent use-after-free during disconnect
- Re-prepare URB descriptors on ghost-to-real takeover to ensure correct sizes
- Add NULL checks before usb_free_coherent() calls in tascam_free_urbs()
Medium fixes:
- Move us144mkii_maybe_start_stream() call after successful URB submission in tascam_midi_open() to prevent stream_refs race condition
- Add cancel_work_sync() calls in probe error path (free_card label)
- Add clarifying comments for error handling flow and ghost-to-real takeover mechanism
- Increment stream_refs only after successful URB submission in maybe_start_stream()
Low fixes:
- Add NULL checks for urb->transfer_buffer in playback_urb_complete() and feedback_urb_complete()
Fixed all coding style issues reported by checkpatch.pl.
This includes:
- Trailing statements on new lines.
- Added missing blank lines after declarations.
- Corrected indentation of switch/case statements and labels.
- Added comments for memory barriers.
- Removed unnecessary braces.
Added Kdocs to all public functions and data structures to
improve code documentation.
This commit includes:
- Reverted audio stream decoupling to restore original behavior.
- Implemented SysEx state machine and error retry for MIDI handling.
- Performed memory leak audit and confirmed no obvious leaks.
- Optimized playback and capture data copying for efficiency.
- Reordered `tascam_card` structure for improved cache locality.
- Fixed `active_urbs` counter management to prevent "URBs still active" errors.