Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729836 > unrolled thread

[PATCH 3.16 177/233] can: gs_usb: fix memory leak in gs_cmd_reset()

Started byBen Hutchings <ben@decadent.org.uk>
First post2017-09-10 01:40 +0200
Last post2017-09-10 01:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 177/233] can: gs_usb: fix memory leak in gs_cmd_reset() Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:40 +0200

#1729836 — [PATCH 3.16 177/233] can: gs_usb: fix memory leak in gs_cmd_reset()

FromBen Hutchings <ben@decadent.org.uk>
Date2017-09-10 01:40 +0200
Subject[PATCH 3.16 177/233] can: gs_usb: fix memory leak in gs_cmd_reset()
Message-ID<unXvX-401-5@gated-at.bofh.it>
3.16.48-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Marc Kleine-Budde <mkl@pengutronix.de>

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 | 2 ++
 1 file changed, 2 insertions(+)

--- 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 *g
 			     sizeof(*dm),
 			     1000);
 
+	kfree(dm);
+
 	return rc;
 }
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web