diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2021-07-27 19:59:57 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-07-30 08:47:05 +0200 |
commit | 0e865f0c31928d6a313269ef624907eec55287c4 (patch) | |
tree | e1677349b9c6038000af3eea20022d19f69fef98 /drivers/net/ethernet/intel/igc/igc_phy.h | |
parent | fc43fb69a7af92839551f99c1a96a37b77b3ae7a (diff) | |
download | linux-0e865f0c31928d6a313269ef624907eec55287c4.tar.bz2 |
can: usb_8dev: fix memory leak
In usb_8dev_start() MAX_RX_URBS coherent buffers are allocated and
there is nothing, that frees them:
1) In callback function the urb is resubmitted and that's all
2) In disconnect function urbs are simply killed, but URB_FREE_BUFFER
is not set (see usb_8dev_start) and this flag cannot be used with
coherent buffers.
So, all allocated buffers should be freed with usb_free_coherent()
explicitly.
Side note: This code looks like a copy-paste of other can drivers. The
same patch was applied to mcba_usb driver and it works nice with real
hardware. There is no change in functionality, only clean-up code for
coherent buffers.
Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices")
Link: https://lore.kernel.org/r/d39b458cd425a1cf7f512f340224e6e9563b07bd.1627404470.git.paskripkin@gmail.com
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_phy.h')
0 files changed, 0 insertions, 0 deletions