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>
Wed, 17 May 2017 09:27:41 +0000 (11:27 +0200)
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 aa3c280fdf8d40662e375466dd3b2648ec037fe1..0782ac6f5edfaa0542dfe173bd6969c8bba77372 100644 (file)
@@ -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: