[PATCH v2] usb: misc: legousbtower: Fix memory leak
From: Maksim Salau
Date: Sat May 13 2017 - 16:49:59 EST
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>
---
v2:
Changed tags to match guidelines.
drivers/usb/misc/legousbtower.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index aa3c280fdf8d..0782ac6f5edf 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -926,6 +926,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
USB_MAJOR, dev->minor);
exit:
+ kfree(get_version_reply);
return retval;
error:
--
2.9.3