can: ems_usb: Fix memory leak on ems_usb_disconnect()
authorAnton Vasilyev <vasilyev@ispras.ru>
Fri, 27 Jul 2018 15:50:42 +0000 (18:50 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 30 Jul 2018 09:04:27 +0000 (11:04 +0200)
ems_usb_probe() allocates memory for dev->tx_msg_buffer, but there
is no its deallocation in ems_usb_disconnect().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/ems_usb.c

index 12ff0020ecd60904b65b89a633cd2a60bf880ed2..b7dfd4109d24ef3db5c03d78fb078f7f7cf6e3ab 100644 (file)
@@ -1072,6 +1072,7 @@ static void ems_usb_disconnect(struct usb_interface *intf)
                usb_free_urb(dev->intr_urb);
 
                kfree(dev->intr_in_buffer);
+               kfree(dev->tx_msg_buffer);
        }
 }