can: gs_usb: fix memory leak in gs_cmd_reset()
authorMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 4 Jun 2017 12:03:42 +0000 (14:03 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 15 Sep 2017 17:30:08 +0000 (18:30 +0100)
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: Ben Hutchings <ben@decadent.org.uk>
drivers/net/can/usb/gs_usb.c

index 047b63caa3b7c2fa67b7751b0ba2bcff5435c4c1..b16c5a2d92fb670b474c73a72387037f77b49406 100644 (file)
@@ -246,6 +246,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)
                             sizeof(*dm),
                             1000);
 
+       kfree(dm);
+
        return rc;
 }