summaryrefslogtreecommitdiff
path: root/net/can
diff options
context:
space:
mode:
authorPavel Skripkin <paskripkin@gmail.com>2021-07-27 20:00:46 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2021-07-30 08:47:34 +0200
commit928150fad41ba16df7fcc9f7f945747d0f56cbb6 (patch)
treefde5069d484f1fcc3b6f2917d6c92424da2d2652 /net/can
parent9969e3c5f40c166e3396acc36c34f9de502929f6 (diff)
can: esd_usb2: fix memory leak
In esd_usb2_setup_rx_urbs() 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 esd_usb2_setup_rx_urbs) 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: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device") Link: https://lore.kernel.org/r/b31b096926dcb35998ad0271aac4b51770ca7cc8.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 'net/can')
0 files changed, 0 insertions, 0 deletions