summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2013-12-14 14:36:25 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2013-12-17 11:19:33 +0100
commit20fb4eb96fb0350d28fc4d7cbfd5506711079592 (patch)
treea7f2cf6940d9296664c987131d07b33b909f4f63
parenta1c31f1d057130cc63e72a09189410d169db7ecf (diff)
downloadlinux-stable-20fb4eb96fb0350d28fc4d7cbfd5506711079592.tar.gz
linux-stable-20fb4eb96fb0350d28fc4d7cbfd5506711079592.tar.bz2
linux-stable-20fb4eb96fb0350d28fc4d7cbfd5506711079592.zip
can: peak_usb: fix mem leak in pcan_usb_pro_init()
This patch fixes a memory leak in pcan_usb_pro_init(). In patch f14e224 net: can: peak_usb: Do not do dma on the stack the struct pcan_usb_pro_fwinfo *fi and struct pcan_usb_pro_blinfo *bi were converted from stack to dynamic allocation va kmalloc(). However the corresponding kfree() was not introduced. This patch adds the missing kfree(). Cc: linux-stable <stable@vger.kernel.org> # v3.10 Reported-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb_pro.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
index 8ee9d1556e6e..263dd921edc4 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
@@ -927,6 +927,9 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
/* set LED in default state (end of init phase) */
pcan_usb_pro_set_led(dev, 0, 1);
+ kfree(bi);
+ kfree(fi);
+
return 0;
err_out: