All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: peak_usb: fix mem leak in pcan_usb_pro_init()
@ 2013-12-14 13:59 Marc Kleine-Budde
  2013-12-16 10:12 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2013-12-14 13:59 UTC (permalink / raw)
  To: linux-can; +Cc: kernel, s.grosjean, Marc Kleine-Budde, linux-stable

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().

Reported-by: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: linux-stable <stable@vger.kernel.org> # v3.10
Cc: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 3 +++
 1 file changed, 3 insertions(+)

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 8ee9d15..263dd92 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:
-- 
1.8.5.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] can: peak_usb: fix mem leak in pcan_usb_pro_init()
  2013-12-14 13:59 [PATCH] can: peak_usb: fix mem leak in pcan_usb_pro_init() Marc Kleine-Budde
@ 2013-12-16 10:12 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2013-12-16 10:12 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, kernel, s.grosjean

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

On 12/14/2013 02:59 PM, Marc Kleine-Budde wrote:
> 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().
> 
> Reported-by: Stephane Grosjean <s.grosjean@peak-system.com>
> Cc: linux-stable <stable@vger.kernel.org> # v3.10
> Cc: Stephane Grosjean <s.grosjean@peak-system.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Stéphane, can I have your Acked-by?

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-16 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-14 13:59 [PATCH] can: peak_usb: fix mem leak in pcan_usb_pro_init() Marc Kleine-Budde
2013-12-16 10:12 ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.