diff mbox

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

Message ID alpine.LNX.2.00.1106111832270.23835@swampdragon.chaosbits.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jesper Juhl June 11, 2011, 4:36 p.m. UTC
We leak the memory allocated to 'phi' when the variable goes out of scope 
in hfcsusb_ph_info().

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

 I have no way to really test this patch, so it is only compile tested.

Comments

David Miller June 12, 2011, 1:59 a.m. UTC | #1
From: Jesper Juhl <jj@chaosbits.net>
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 <jj@chaosbits.net>

Applied, thanks Jesper.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);
 }
 
 /*