Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 9 Mar 2003 17:53:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 9 Mar 2003 17:53:01 -0500 Received: from phobos.planet.net.au ([203.15.90.5]:32522 "HELO phobos.planet.net.au") by vger.kernel.org with SMTP id ; Sun, 9 Mar 2003 17:53:00 -0500 Date: Mon, 10 Mar 2003 09:48:29 +1100 (EST) From: Neale Banks To: Oleg Drokin Cc: alan@redhat.com, linux-kernel@vger.kernel.org, torvalds@transmeta.com Subject: Re: Memleak in ircomm_core In-Reply-To: <20030309211434.GA31791@linuxhacker.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 981 Lines: 39 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. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/