public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "hinko.kocevar@cetrtapot.si" <hinko.kocevar@cetrtapot.si>
To: Samuel Ortiz <samuel@sortiz.org>
Cc: irda-users@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [irda-users] [PATCH] irlmp_unregister_link needs to free lsaps hashbin
Date: Mon, 15 Oct 2007 09:43:07 +0200	[thread overview]
Message-ID: <47131A0B.1050000@cetrtapot.si> (raw)
In-Reply-To: <20071013010326.GC8187@sortiz.org>

Samuel Ortiz wrote:
> Hi Hinko,
> 
> On Fri, Oct 12, 2007 at 02:56:27PM +0200, hinko.kocevar@cetrtapot.si wrote:
>> Hi,
>>
>> While testing the mcs7780 based IrDA USB dongle I've stumbled upon
>> memory leak in irlmp_unregister_link(). Hashbin for lsaps is created in
>> irlmp_register_link and should probably be freed in irlmp_unregister_link().
>>
>> Signed-off-by: Hinko Kocevar <hinko.kocevar@cetrtapot.si>
>>
>> Best regards,
>> Hinko
>>
>> ----
>>
>>
> 
>> --- linux-2.6.23/net/irda/irlmp.c.orig	2007-10-12 14:05:17.000000000 +0200
>> +++ linux-2.6.23/net/irda/irlmp.c	2007-10-12 14:05:41.000000000 +0200
>> @@ -353,6 +353,7 @@ void irlmp_unregister_link(__u32 saddr)
>>  		/* Final cleanup */
>>  		del_timer(&link->idle_timer);
>>  		link->magic = 0;
>> +		hashbin_delete(link->lsaps, (FREE_FUNC) kfree);
> Good catch, but I think the right fix sould be:
> +             hashbin_delete(link->lsaps, (FREE_FUNC) __irlmp_close_lsap);
> 

You're probably right since struct lsap_cb get inserted into the hashbin.

Regards,
Hinko

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar@cetrtapot.si
Http: www.cetrtapot.si


      reply	other threads:[~2007-10-15  7:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-12 12:56 [PATCH] irlmp_unregister_link needs to free lsaps hashbin hinko.kocevar
2007-10-13  1:03 ` [irda-users] " Samuel Ortiz
2007-10-15  7:43   ` hinko.kocevar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47131A0B.1050000@cetrtapot.si \
    --to=hinko.kocevar@cetrtapot.si \
    --cc=irda-users@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel@sortiz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox