summaryrefslogtreecommitdiff
path: root/drivers/net/can/usb
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2017-06-04 15:03:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-26 08:13:08 +0300
commit58ab7a86cdc29de64cea665fa97f02829756b554 (patch)
tree7a0a3d9a0c94516f9639cc1745d50633abf3d834 /drivers/net/can/usb
parent0ad134d81c070a391783f84d7ab9dd13ad6ef7e9 (diff)
downloadlinux-58ab7a86cdc29de64cea665fa97f02829756b554.tar.xz
can: gs_usb: fix memory leak in gs_cmd_reset()
commit 5cda3ee5138e91ac369ed9d0b55eab0dab077686 upstream. This patch adds the missing kfree() in gs_cmd_reset() to free the memory that is not used anymore after usb_control_msg(). Cc: Maximilian Schneider <max@schneidersoft.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r--drivers/net/can/usb/gs_usb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index cbc99d5649af..ae5709354546 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -246,6 +246,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)
sizeof(*dm),
1000);
+ kfree(dm);
+
return rc;
}