From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: Tomas Targownik <ttargownik@geicp.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Memory leak on failed connection attempt
Date: Thu, 30 Jun 2011 02:22:07 -0300 [thread overview]
Message-ID: <20110630052207.GB3438@joana> (raw)
In-Reply-To: <1308868481.2042.58.camel@rnd3>
Hi Tomas,
* Tomas Targownik <ttargownik@geicp.com> [2011-06-24 08:34:41 +1000]:
> I have isolated the memory leak to the hci_conn struct not being freed
> on a hci_conn_del() call if the remote bluetooth device is not present.
> The patch below remedies this.
>
> ---
> net/bluetooth/hci_conn.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index 7a6f56b..62510f7 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -375,6 +375,11 @@ int hci_conn_del(struct hci_conn *conn)
>
> hci_dev_put(hdev);
>
> + if (conn->handle == 0)
> + {
> + kfree(conn);
> + }
> +
> return 0;
I agree with this patch, but just send me a git formatted patch with proper
coding style.
Gustavo
next prev parent reply other threads:[~2011-06-30 5:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-02 6:48 Memory leak on failed connection attempt Tomas Targownik
2011-06-02 13:57 ` Gustavo F. Padovan
2011-06-14 7:03 ` Tomas Targownik
2011-06-15 23:22 ` Tomas Targownik
2011-06-16 21:26 ` Gustavo F. Padovan
2011-06-20 3:15 ` Tomas Targownik
2011-06-23 22:34 ` Tomas Targownik
2011-06-30 5:22 ` Gustavo F. Padovan [this message]
2011-07-04 1:40 ` Tomas Targownik
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=20110630052207.GB3438@joana \
--to=padovan@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
--cc=ttargownik@geicp.com \
/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;
as well as URLs for NNTP newsgroup(s).