Re: [PATCH] usb: xhci: fix EP0 context leak on virt device allocation failure
From: Anfernee Cao
Date: Sat Oct 17 2026 - 07:36:22 EST
> Does jumping to disable_slot here actually disable the newly enabled
> slot_id?
Yes, you're right, and thanks for catching it. The disable_slot label
should pass the local slot_id.
This is a pre-existing bug, separate from the EP0 context accounting
leak fixed by this patch, and it has already been submitted:
[PATCH] usb: xhci: disable the correct slot on alloc_dev failure
https://patchew.org/linux/6C94F1F35FF16E76+20260806084909.2959131-1-raoxu@xxxxxxxxxxxxx/
Fixes: 3ffbba9511b4 ("USB: xhci: Allocate and address USB devices")
I deliberately kept this patch independent of that one. The decrement
added here releases the endpoint context reservation made by this
invocation, regardless of which slot the current error path ends up
disabling. Once Xu Rao's fix lands, the error path will disable the
correct slot and the two fixes compose cleanly.
If the maintainers prefer, I can resend this rebased on top of that fix
once it is applied, or send both as a series.