* pull request: linux-can 2012-04-16
@ 2012-04-16 19:43 Marc Kleine-Budde
2012-04-16 19:43 ` [PATCH] can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths Marc Kleine-Budde
2012-04-17 3:46 ` pull request: linux-can 2012-04-16 David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2012-04-16 19:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-can, kernel
Hello David,
there's a fix targetting net/master from Jesper Juhl, fixing a mem leak
in the error path of the pcan_usb_pro driver.
redards,
Marc
The following changes since commit 8a9a0ea6032186e3030419262678d652b88bf6a8:
net/ethernet: ks8851_mll fix rx frame buffer overflow (2012-04-14 15:21:27 -0400)
are available in the git repository at:
git://gitorious.org/linux-can/linux-can.git master
Jesper Juhl (1):
can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths
drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths
2012-04-16 19:43 pull request: linux-can 2012-04-16 Marc Kleine-Budde
@ 2012-04-16 19:43 ` Marc Kleine-Budde
2012-04-17 3:46 ` pull request: linux-can 2012-04-16 David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2012-04-16 19:43 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-can, kernel, Jesper Juhl, Marc Kleine-Budde
From: Jesper Juhl <jj@chaosbits.net>
If either call to pcan_usb_pro_send_req() in
drivers/net/can/usb/peak_usb/pcan_usb_pro.c::pcan_usb_pro_init()
fails, we'll leak the memory we allocated to 'usb_if' with kzalloc()
when the 'usb_if' variable goes out of scope without having been
assigned to anything as we 'return err;'.
Fix this by adding appropriate kfree(usb_if) calls to the error paths.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: 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 | 2 ++
1 files changed, 2 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 5234586..629c4ba 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
@@ -875,6 +875,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
PCAN_USBPRO_INFO_FW,
&fi, sizeof(fi));
if (err) {
+ kfree(usb_if);
dev_err(dev->netdev->dev.parent,
"unable to read %s firmware info (err %d)\n",
pcan_usb_pro.name, err);
@@ -885,6 +886,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
PCAN_USBPRO_INFO_BL,
&bi, sizeof(bi));
if (err) {
+ kfree(usb_if);
dev_err(dev->netdev->dev.parent,
"unable to read %s bootloader info (err %d)\n",
pcan_usb_pro.name, err);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: pull request: linux-can 2012-04-16
2012-04-16 19:43 pull request: linux-can 2012-04-16 Marc Kleine-Budde
2012-04-16 19:43 ` [PATCH] can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths Marc Kleine-Budde
@ 2012-04-17 3:46 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2012-04-17 3:46 UTC (permalink / raw)
To: mkl; +Cc: netdev, linux-can, kernel
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 16 Apr 2012 21:43:07 +0200
> Hello David,
>
> there's a fix targetting net/master from Jesper Juhl, fixing a mem leak
> in the error path of the pcan_usb_pro driver.
>
> redards,
> Marc
>
> The following changes since commit 8a9a0ea6032186e3030419262678d652b88bf6a8:
>
> net/ethernet: ks8851_mll fix rx frame buffer overflow (2012-04-14 15:21:27 -0400)
>
> are available in the git repository at:
> git://gitorious.org/linux-can/linux-can.git master
Pulled, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths
@ 2012-04-13 7:44 Stephane Grosjean
0 siblings, 0 replies; 5+ messages in thread
From: Stephane Grosjean @ 2012-04-13 7:44 UTC (permalink / raw)
To: linux-can Mailing List
Cc: linux-usb Mailing List, Stephane Grosjean, Jesper Juhl
If either call to pcan_usb_pro_send_req() in
drivers/net/can/usb/peak_usb/pcan_usb_pro.c::pcan_usb_pro_init()
fails, we'll leak the memory we allocated to 'usb_if' with kzalloc()
when the 'usb_if' variable goes out of scope without having been
assigned to anything as we 'return err;'.
Fix this by adding appropriate kfree(usb_if) calls to the error paths.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Stephane Grosjean <s.grosjean@peak-system.com>
---
drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 2 ++
1 files changed, 2 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 5234586..629c4ba 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
@@ -875,6 +875,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
PCAN_USBPRO_INFO_FW,
&fi, sizeof(fi));
if (err) {
+ kfree(usb_if);
dev_err(dev->netdev->dev.parent,
"unable to read %s firmware info (err %d)\n",
pcan_usb_pro.name, err);
@@ -885,6 +886,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
PCAN_USBPRO_INFO_BL,
&bi, sizeof(bi));
if (err) {
+ kfree(usb_if);
dev_err(dev->netdev->dev.parent,
"unable to read %s bootloader info (err %d)\n",
pcan_usb_pro.name, err);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths
@ 2012-04-11 21:23 Jesper Juhl
0 siblings, 0 replies; 5+ messages in thread
From: Jesper Juhl @ 2012-04-11 21:23 UTC (permalink / raw)
To: linux-can
Cc: Stephane Grosjean, Wolfgang Grandegger, Marc Kleine-Budde,
netdev, linux-kernel
If either call to pcan_usb_pro_send_req() in
drivers/net/can/usb/peak_usb/pcan_usb_pro.c::pcan_usb_pro_init()
fails, we'll leak the memory we allocated to 'usb_if' with kzalloc()
when the 'usb_if' variable goes out of scope without having been
assigned to anything as we 'return err;'.
Fix this by adding appropriate kfree(usb_if) calls to the error paths.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 2 ++
1 file changed, 2 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 5234586..629c4ba 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
@@ -875,6 +875,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
PCAN_USBPRO_INFO_FW,
&fi, sizeof(fi));
if (err) {
+ kfree(usb_if);
dev_err(dev->netdev->dev.parent,
"unable to read %s firmware info (err %d)\n",
pcan_usb_pro.name, err);
@@ -885,6 +886,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
PCAN_USBPRO_INFO_BL,
&bi, sizeof(bi));
if (err) {
+ kfree(usb_if);
dev_err(dev->netdev->dev.parent,
"unable to read %s bootloader info (err %d)\n",
pcan_usb_pro.name, err);
--
1.7.10
(please CC me on replies)
--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-04-17 3:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 19:43 pull request: linux-can 2012-04-16 Marc Kleine-Budde
2012-04-16 19:43 ` [PATCH] can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths Marc Kleine-Budde
2012-04-17 3:46 ` pull request: linux-can 2012-04-16 David Miller
-- strict thread matches above, loose matches on Subject: below --
2012-04-13 7:44 [PATCH] can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths Stephane Grosjean
2012-04-11 21:23 Jesper Juhl
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.