From: Anton Vasilyev Date: Fri, 27 Jul 2018 15:50:42 +0000 (+0300) Subject: can: ems_usb: Fix memory leak on ems_usb_disconnect() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c8159f9a1ae9c9ea76b389666a37bd9263a761cd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git can: ems_usb: Fix memory leak on ems_usb_disconnect() commit 72c05f32f4a5055c9c8fe889bb6903ec959c0aad upstream. 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 Cc: Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index b00358297424..d0846ae9e0e4 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c @@ -1071,6 +1071,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); } }