[PATCH: 3.11] usb_8dev: Fix memory leak in usb_8dev_start_xmit

3 messages, 3 authors, 2014-03-29 · open the first message on its own page

[PATCH: 3.11] usb_8dev: Fix memory leak in usb_8dev_start_xmit

From: Bjorn Van Tilt <hidden>
Date: 2014-03-24 14:13:58

Fixed a memory leak when an error occurred in the transmit function.
In the error handling the urb wasn't freed before returning. There was
also a call to the usb_unanchor_urb() function but the urb wasn't
anchored.

Signed-off-by: Bjorn Van Tilt <redacted>

---
--- drivers/net/can/usb/usb_8dev.c.orig 2014-03-24 13:40:45.000000000 +0100
+++ drivers/net/can/usb/usb_8dev.c 2014-03-24 13:44:32.076086036 +0100
@@ -698,8 +698,8 @@ static netdev_tx_t usb_8dev_start_xmit(s
  return NETDEV_TX_OK;

 nofreecontext:
- usb_unanchor_urb(urb);
  usb_free_coherent(priv->udev, size, buf, urb->transfer_dma);
+ usb_free_urb(urb);

  netdev_warn(netdev, "couldn't find free context");

Re: [PATCH: 3.11] usb_8dev: Fix memory leak in usb_8dev_start_xmit

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2014-03-24 14:34:25

On 03/24/2014 03:13 PM, Bjorn Van Tilt wrote:
Fixed a memory leak when an error occurred in the transmit function.
In the error handling the urb wasn't freed before returning. There was
also a call to the usb_unanchor_urb() function but the urb wasn't
anchored.

Signed-off-by: Bjorn Van Tilt <redacted>
Applied to the can tree.

Tnx,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Re: [PATCH: 3.11] usb_8dev: Fix memory leak in usb_8dev_start_xmit

From: Bernd Krumboeck <hidden>
Date: 2014-03-29 07:25:37

Applied to the driver sources (outside kernel tree): https://github.com/krumboeck/usb2can

Thank you!


regards,
Bernd



Am 2014-03-24 15:13, schrieb Bjorn Van Tilt:
quoted hunk
Fixed a memory leak when an error occurred in the transmit function.
In the error handling the urb wasn't freed before returning. There was
also a call to the usb_unanchor_urb() function but the urb wasn't
anchored.

Signed-off-by: Bjorn Van Tilt <redacted>

---
--- drivers/net/can/usb/usb_8dev.c.orig 2014-03-24 13:40:45.000000000 +0100
+++ drivers/net/can/usb/usb_8dev.c 2014-03-24 13:44:32.076086036 +0100
@@ -698,8 +698,8 @@ static netdev_tx_t usb_8dev_start_xmit(s
   return NETDEV_TX_OK;

  nofreecontext:
- usb_unanchor_urb(urb);
   usb_free_coherent(priv->udev, size, buf, urb->transfer_dma);
+ usb_free_urb(urb);

   netdev_warn(netdev, "couldn't find free context");

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help