Re: [PATCH] ALSA: usb-audio: scarlett2: unwind notify URB init failures
From: Yousef Alhouseen
Date: Tue Jun 30 2026 - 16:42:31 EST
Thanks, Takashi. I missed the common cleanup in snd_usb_mixer_free().
Please drop this patch.
On Tue, 30 Jun 2026 14:23:43 +0200, Takashi Iwai <tiwai@xxxxxxx> wrote:
> On Mon, 29 Jun 2026 18:02:32 +0200,
> Yousef Alhouseen wrote:
> >
> > scarlett2_init_notify() stores the newly allocated URB in mixer->urb
> > before allocating the transfer buffer and submitting the URB. If a later
> > step fails, the function returns an error while leaving a partially
> > initialized notification URB attached to the mixer.
> >
> > Clean up the URB and transfer buffer locally on those failure paths.
> > Leave mixer->urb NULL so later cleanup or retry paths do not see a
> > stale notification URB.
>
> Those are released by the common snd_usb_mixer_free() in the error
> path of snd_usb_create_mixer(), hence no need to do here.
>
> thanks,
>
> Takashi