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
Anton Vasilyev authored and Greg Kroah-Hartman committed Aug 6, 2018
1 parent 581c294 commit 7dfa787
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 @@ -1078,6 +1078,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 7dfa787

Please sign in to comment.