netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irda: irttp: fix memory leak in irttp_open_tsap() error path
@ 2012-11-26 14:16 Tommi Rantala
  2012-11-28 16:25 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Tommi Rantala @ 2012-11-26 14:16 UTC (permalink / raw)
  To: netdev; +Cc: Samuel Ortiz, David S. Miller, Dave Jones, Tommi Rantala

Cleanup the memory we allocated earlier in irttp_open_tsap() when we hit
this error path. The leak goes back to at least 1da177e4
("Linux-2.6.12-rc2").

Discovered with Trinity (the syscall fuzzer).

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
---
 net/irda/irttp.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index 1002e33..ae43c62 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -441,6 +441,7 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify)
 	lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0);
 	if (lsap == NULL) {
 		IRDA_DEBUG(0, "%s: unable to allocate LSAP!!\n", __func__);
+		__irttp_close_tsap(self);
 		return NULL;
 	}
 
-- 
1.7.9.5

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

* Re: [PATCH] irda: irttp: fix memory leak in irttp_open_tsap() error path
  2012-11-26 14:16 [PATCH] irda: irttp: fix memory leak in irttp_open_tsap() error path Tommi Rantala
@ 2012-11-28 16:25 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-11-28 16:25 UTC (permalink / raw)
  To: tt.rantala; +Cc: netdev, samuel, davej

From: Tommi Rantala <tt.rantala@gmail.com>
Date: Mon, 26 Nov 2012 16:16:44 +0200

> Cleanup the memory we allocated earlier in irttp_open_tsap() when we hit
> this error path. The leak goes back to at least 1da177e4
> ("Linux-2.6.12-rc2").
> 
> Discovered with Trinity (the syscall fuzzer).
> 
> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>

Applied, thanks.

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

end of thread, other threads:[~2012-11-28 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-26 14:16 [PATCH] irda: irttp: fix memory leak in irttp_open_tsap() error path Tommi Rantala
2012-11-28 16:25 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).