Re: [PATCH v3] usb: misc: legousbtower: Fix buffers on stack

From: Maksim Salau
Date: Thu May 04 2017 - 15:12:37 EST


> > @@ -913,6 +929,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
>
> Don't you need to free get_version_reply here?
>
> > return retval;
> >
> > error:
> > + kfree(get_version_reply);
> > tower_delete(dev);
> > return retval;
> > }

Thank you very much, Heikki!

I was so focused on failure cases, that missed memory leak in the case
when all calls succeeded.

I'll prepare a patch shortly to fix this.

Regards,
Maksim.