Skip to content

Commit

Permalink
can: ems_usb: Fix memory leak on ems_usb_disconnect()
Browse files Browse the repository at this point in the history
commit 72c05f3 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 <vasilyev@ispras.ru>
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Druidos authored and gregkh committed Aug 9, 2018
1 parent 4a60e54 commit a64e47e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/can/usb/ems_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,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);
}
}

Expand Down

0 comments on commit a64e47e

Please sign in to comment.