Skip to contentSkip to conversation

xhci: Fix ring leak in failure path of xhci_alloc_virt_device()

stable,3.18-4.9 Greg KH 1 participant 1 message Jan 11, 2018

Subsystems (2)
lore
Share & tools
lore

Greg KH

author
#0 lore raw
Quoted 4 lines · Ben Hutchings

This is a stable-only fix for the backport of commit 5d9b70f7d52e ("xhci: Don't add a virt_dev to the devs array before it's fully allocated").

Quoted 8 lines

In branches that predate commit c5628a2af83a ("xhci: remove endpoint ring cache") there is an additional failure path in xhci_alloc_virt_device() where ring cache allocation fails, in which case we need to free the ring allocated for endpoint 0.

---
This is build-tested only.

Looks good to me, thanks for this!

Mathias, yell if you think it's wrong :)

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html