[PATCH 4.9 002/164] usb: misc: legousbtower: Fix memory leak
From: Greg Kroah-Hartman
Date: Tue May 23 2017 - 16:24:51 EST
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maksim Salau <maksim.salau@xxxxxxxxx>
commit 0bd193d62b4270a2a7a09da43ad1034c7ca5b3d3 upstream.
get_version_reply is not freed if function returns with success.
Fixes: 942a48730faf ("usb: misc: legousbtower: Fix buffers on stack")
Reported-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
Signed-off-by: Maksim Salau <maksim.salau@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/usb/misc/legousbtower.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -941,6 +941,7 @@ static int tower_probe (struct usb_inter
USB_MAJOR, dev->minor);
exit:
+ kfree(get_version_reply);
return retval;
error: