usb: misc: legousbtower: Fix memory leak
authorMaksim Salau <maksim.salau@gmail.com>
Sat, 13 May 2017 20:49:26 +0000 (23:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 12:30:07 +0000 (14:30 +0200)
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@linux.intel.com>
Signed-off-by: Maksim Salau <maksim.salau@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/legousbtower.c

index 9da8eefbb93542ed39dbd054e5f72e5672cf9be3..0ec9ee573ffa7f12ab101e086c9b297a896dc800 100644 (file)
@@ -953,6 +953,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: