can: ems_usb: fix urb leaks on failure paths
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 6 Dec 2013 23:10:35 +0000 (03:10 +0400)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 17 Dec 2013 10:19:11 +0000 (11:19 +0100)
commita1c31f1d057130cc63e72a09189410d169db7ecf
treeac0e5e0f58916ea7584076ce443600307faf7458
parent9bd7d20c45157c175bfd45449e904a404506f99c
can: ems_usb: fix urb leaks on failure paths

There are a couple failure paths where urb leaks.
Is spare code within ems_usb_start_xmit(),
usb_free_urb() should be used to deallocate urb instead of usb_unanchor_urb().
In ems_usb_start() there is no usb_free_urb() if usb_submit_urb() fails.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Sebastian Haas <dev@sebastianhaas.info>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/ems_usb.c