[PATCH] ISDN, hfcsusb: Don't leak in hfcsusb_ph_info()

Subsystems: the rest

STALE5573d

2 messages, 2 authors, 2011-06-12 · open the first message on its own page

[PATCH] ISDN, hfcsusb: Don't leak in hfcsusb_ph_info()

From: Jesper Juhl <hidden>
Date: 2011-06-11 16:45:08

We leak the memory allocated to 'phi' when the variable goes out of scope 
in hfcsusb_ph_info().

Signed-off-by: Jesper Juhl <redacted>
---
 hfcsusb.c |    1 +
 1 file changed, 1 insertion(+)

 I have no way to really test this patch, so it is only compile tested.
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index 3ccbff1..71a8eb6 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -283,6 +283,7 @@ hfcsusb_ph_info(struct hfcsusb *hw)
 	_queue_data(&dch->dev.D, MPH_INFORMATION_IND, MISDN_ID_ANY,
 		sizeof(struct ph_info_dch) + dch->dev.nrbchan *
 		sizeof(struct ph_info_ch), phi, GFP_ATOMIC);
+	kfree(phi);
 }
 
 /*

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

Re: [PATCH] ISDN, hfcsusb: Don't leak in hfcsusb_ph_info()

From: David Miller <davem@davemloft.net>
Date: 2011-06-12 02:00:37

From: Jesper Juhl <redacted>
Date: Sat, 11 Jun 2011 18:36:42 +0200 (CEST)
We leak the memory allocated to 'phi' when the variable goes out of scope 
in hfcsusb_ph_info().

Signed-off-by: Jesper Juhl <redacted>
Applied, thanks Jesper.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help