Thanks Tom — you're right, that `goto` after `return` is unreachable. I'll fix that and resend with the corrected flow.
пт, 16 мая 2025 г. в 21:31, Tom Rini <tr...@konsulko.com>: > On Fri, May 16, 2025 at 08:54:34PM +0300, ant.v.morya...@gmail.com wrote: > > > From: Anton Moryakov <ant.v.morya...@gmail.com> > > > > Ensure int_queue is properly destroyed when receiving wrong buffer > > by adding error handling path. Fixes memory leak that occurred > > when backbuffer validation failed. > > > > Signed-off-by: Anton Moryakov <ant.v.morya...@gmail.com> > > --- > > drivers/usb/host/ehci-hcd.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c > > index 7d5519c65a9..765d8b327ee 100644 > > --- a/drivers/usb/host/ehci-hcd.c > > +++ b/drivers/usb/host/ehci-hcd.c > > @@ -1557,6 +1557,7 @@ static int _ehci_submit_int_msg(struct usb_device > *dev, unsigned long pipe, > > debug("got wrong buffer back (%p instead of %p)\n", > > backbuffer, buffer); > > return -EINVAL; > > + goto err; > > A goto after return cannot be right, and should have had some compiler > warnings too. > > -- > Tom >