[PATCH 3.18 59/59] usb: misc: legousbtower: Fix memory leak

From: Greg Kroah-Hartman
Date: Tue May 23 2017 - 17:03:38 EST


3.18-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
@@ -954,6 +954,7 @@ static int tower_probe (struct usb_inter


exit:
+ kfree(get_version_reply);
return retval;

error: