• Takashi Iwai's avatar
    ALSA: usb-audio: Handle invalid running state at releasing EP · d6cda465
    Takashi Iwai authored
    When we stop an endpoint in release_urbs(), it ignores the
    inconsistent endpoint state and tries to release the resources.
    This shouldn't happen in theory, but it's still safer to abort the
    release and let the caller proper error handling.
    
    Also, stop_and_unlink_urbs() called from release_urbs() does two step
    works, and it's more straightforward to split this to two functions
    again, so that the call from the PCM trigger won't take the path with
    sleeping.
    
    This patch modifies the EP management code to adapt two points above.
    
    Fixes: d0f09d1e ("ALSA: usb-audio: Refactoring endpoint URB deactivation")
    Cc: <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20210206203052.15606-2-tiwai@suse.de
    
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    d6cda465