Re: [PATCH] ALSA: usb-audio: Kill MIDI 2.0 URBs before freeing endpoints
From: Cen Zhang
Date: Thu Jun 18 2026 - 08:23:12 EST
Hi, Takashi
> Thanks for the patch. This can be good as a quick paper-over, so that
> it can be easily backported. But the proper fix would be rather to
> call the core part of __usb_audio_disconnect() at the error path
> (something like below -- based on the latest tree).
>
> That said, I can take your patch as a quick fix, but could you correct
> the patch for avoiding the doubly disconnection procedure? The code
> should have a check of ep->disconnected, such as:
>
Thanks for your review and guidence. I followed your suggestion and
reworked the fix accordingly:
the common component cleanup is now shared with the probe error path, and the
MIDI 2.0 endpoint destructor keeps the ep->disconnected guard to avoid double
disconnect.
Best regards,
Cen Zhang