* Memleak in ircomm_core
@ 2003-03-09 21:14 Oleg Drokin
2003-03-09 22:48 ` Neale Banks
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Drokin @ 2003-03-09 21:14 UTC (permalink / raw)
To: alan, linux-kernel; +Cc: torvalds
Hello!
There seems to be a memleak on error exit path. The same patch should apply
to 2.5 and 2.4
Found with help of smatch + enhanced unfree script.
Bye,
Oleg
===== net/irda/ircomm/ircomm_core.c 1.5 vs edited =====
--- 1.5/net/irda/ircomm/ircomm_core.c Tue Aug 6 22:23:24 2002
+++ edited/net/irda/ircomm/ircomm_core.c Mon Mar 10 00:10:10 2003
@@ -121,8 +121,10 @@
} else
ret = ircomm_open_tsap(self);
- if (ret < 0)
+ if (ret < 0) {
+ kfree(self);
return NULL;
+ }
self->service_type = service_type;
self->line = line;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Memleak in ircomm_core
2003-03-09 21:14 Memleak in ircomm_core Oleg Drokin
@ 2003-03-09 22:48 ` Neale Banks
0 siblings, 0 replies; 2+ messages in thread
From: Neale Banks @ 2003-03-09 22:48 UTC (permalink / raw)
To: Oleg Drokin; +Cc: alan, linux-kernel, torvalds
On Mon, 10 Mar 2003, Oleg Drokin wrote:
> Hello!
>
> There seems to be a memleak on error exit path. The same patch should apply
> to 2.5 and 2.4
>
> Found with help of smatch + enhanced unfree script.
>
> Bye,
> Oleg
>
> ===== net/irda/ircomm/ircomm_core.c 1.5 vs edited =====
> --- 1.5/net/irda/ircomm/ircomm_core.c Tue Aug 6 22:23:24 2002
> +++ edited/net/irda/ircomm/ircomm_core.c Mon Mar 10 00:10:10 2003
> @@ -121,8 +121,10 @@
> } else
> ret = ircomm_open_tsap(self);
>
> - if (ret < 0)
> + if (ret < 0) {
> + kfree(self);
> return NULL;
> + }
>
> self->service_type = service_type;
> self->line = line;
> -
Must be an old one - looks like the same patch is needed in 2.2.24-rc5.
HTH,
Neale.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-09 22:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-09 21:14 Memleak in ircomm_core Oleg Drokin
2003-03-09 22:48 ` Neale Banks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox